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.