Email Attachments  Topic is solved

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

Email Attachments

Postby Nina Tulic » Thu Jun 09, 2016 3:13 pm

Hi Guys,

I have a client that would like their T&C's to go out as a separate PDF attachment when emailing out their quotes. Do you have an example of how this can be done? I have searched through the forum but have not been able to find any related topics.

Thanks
Nina
Nina Tulic
Occasional Contributor
Occasional Contributor
 
Posts: 35
Joined: Fri Feb 14, 2014 11:03 am
Topics Solved: 0

Re: Email Attachments

Postby Scott.Pearce » Fri Jun 10, 2016 12:12 pm

I can't find anything in our library here, so I'd have to say no, we don't. Off the top of my head you should be able to hook into the JiwaFinancials.Jiwa.JiwaApplication.JiwaEmail.EmailMessage.SaveStart event, examine the emailMessageObject.Status, emailMessageObject.OriginalStatus, and emailMessageObject.SourceForm values, and based on those add your .pdf file to the emailMessageObject.Attachments collection.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: Email Attachments

Postby Nina Tulic » Tue Jun 14, 2016 3:51 pm

Hi Scott,

I'm sorry but my technical understanding is quite basic. Are you able to elaborate on your answer or provide an example of what you have described?

Thanks
Nina
Nina Tulic
Occasional Contributor
Occasional Contributor
 
Posts: 35
Joined: Fri Feb 14, 2014 11:03 am
Topics Solved: 0

Re: Email Attachments

Postby Mike.Sheen » Tue Jun 14, 2016 7:36 pm

Nina Tulic wrote: or provide an example of what you have described?


In order to do so, we'd pretty much have to provide a plugin which will fulfil your requirements, which would be a couple of hours of work in development and testing - and we can't do that for free.

If you contact [email protected] with a request for a quote, that will get the process started.

Mike
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: Email Attachments

Postby Nina Tulic » Wed Jun 15, 2016 10:17 am

Hi Mike,

This is something that we would prefer to do ourselves so that we can start building our knowledge in terms of Jiwa plugins. We understand that we need to modify the Sales Quote Custom Email plugin but we are unclear as to how to do this given the information provided by Scott. Are you able to give us a starting point.

Thanks
Nina
Nina Tulic
Occasional Contributor
Occasional Contributor
 
Posts: 35
Joined: Fri Feb 14, 2014 11:03 am
Topics Solved: 0

Re: Email Attachments  Topic is solved

Postby Mike.Sheen » Wed Jun 15, 2016 8:01 pm

Ok, so inside the Sales Quote Custom Email plugin there is a line of code (line 75):

Code: Select all
salesQuoteForm.SalesQuote.Email(emailReportDialog.SelectedReport, emailReportDialog.NameToGiveAttachment, emailReportDialog.From, emailReportDialog.EmailTo, emailReportDialog.RequestReadReceipt, emailReportDialog.Subject, emailReportDialog.CC, emailReportDialog.BCC, emailReportDialog.Message, ExportFormatType)


That is a method provided for convenience which performs the following:
  • Generates a report and saves as PDF to a temporary file location
  • Creates a new email message
  • Attaches the temporary PDF to the email
  • Saves/Sends the email
  • Adds to the email log of the quote the email
  • Saves the quote

What you need to do is right before that call to salesQuoteForm.SalesQuote.Email, you add a handler for the AfterBusinessLogicSetup of the JiwaApplication.Manager instance - and in that handler, check that an email type business logic is being created, if so then add a handler there for the Email's SaveStart event - and in that handler add your additional attachment to the email, then remove your handler for the SaveStart event, and then after the call to salesQuoteForm.SalesQuote.Email remove your handler for the AfterBusinessLogicSetup event of JiwaApplication.Manager.
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


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 5 guests