Add another attachment to sales order email  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Add another attachment to sales order email

Postby SBarnes » Thu Jul 16, 2020 1:38 pm

The line below will email a sales orders as a pdf, I want to add a second attachment namely a specific csv of the order is there a way to do this?


Code: Select all
salesOrder.Email(report,attachmentName, "EmailFromHere",EmailTo,false, subject,"","",message,CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Add another attachment to sales order email  Topic is solved

Postby Mike.Sheen » Thu Jul 16, 2020 5:19 pm

That method, Email, from the sales order class ultimately results in a JiwaApplication.JiwaEmail.EmailMessage being created via the business logic factory, and then a Save() of that being invoked.

So, in order to add more documents to the Attachments collection, you would need to add a handler for the SaveStart of the JiwaApplication.JiwaEmail.EmailMessage object before the salesOrder.Email() method is invoked.

On the surface it seems it should be easy enough - let us know if you can't get that to work and I can try to work it out myself.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Add another attachment to sales order email

Postby SBarnes » Thu Jul 16, 2020 5:43 pm

Hi Mike,

Ok thanks I would assume source type will tell me its the sales order and Source ID will be the InvoiceID?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 6 guests