So I know there are two ways to add attachments to mandrill...
"ms.attachments" -- this is just a comma delimited list of file locations on the server
"ms.attachmentsArray" -- an array of attachments where you set the name, type, and content
Is there a way to combine these two in the same mandrill call?
Here is my use case, a user selects certain files that are attached to a particular unique ID (they will select these from a list which will give me the file paths), but they will also want to send an invoice along with these files (the invoice doesn't exist as a file on the server but would be printed using the report server and the xBasic option to add it to an email in mandrill). In selwyn's video he uses the ms.attachmentsArray of mandril but it doesn't look like there is a way to dynamically set how many attachments there are when you set up this variable (unless you can say attachmentsArray[] and then just add as many as you want?). So I was thinking I could maybe combine these two options to do what I want, anyone know if this is possible?
I figure my other option (which I'm still not sure yet how to implement) would be to save the printed report (using the a5_report_saveAs method) and then just using ms.attachments to send the attachments with the email but I'm not sure the timing would work (i.e. giving the report enough time to save so that when I get a pointer to its file location it will exist to send). I'm also weary about this procedure because I don't want to end up with a bunch of duplicate invoice reports sitting on the server (and I'm not sure there is an easy way to delete the invoice file after it is confirmed the email is sent to the mandrill service).
Thanks for any feedback!
"ms.attachments" -- this is just a comma delimited list of file locations on the server
"ms.attachmentsArray" -- an array of attachments where you set the name, type, and content
Is there a way to combine these two in the same mandrill call?
Here is my use case, a user selects certain files that are attached to a particular unique ID (they will select these from a list which will give me the file paths), but they will also want to send an invoice along with these files (the invoice doesn't exist as a file on the server but would be printed using the report server and the xBasic option to add it to an email in mandrill). In selwyn's video he uses the ms.attachmentsArray of mandril but it doesn't look like there is a way to dynamically set how many attachments there are when you set up this variable (unless you can say attachmentsArray[] and then just add as many as you want?). So I was thinking I could maybe combine these two options to do what I want, anyone know if this is possible?
I figure my other option (which I'm still not sure yet how to implement) would be to save the printed report (using the a5_report_saveAs method) and then just using ms.attachments to send the attachments with the email but I'm not sure the timing would work (i.e. giving the report enough time to save so that when I get a pointer to its file location it will exist to send). I'm also weary about this procedure because I don't want to end up with a bunch of duplicate invoice reports sitting on the server (and I'm not sure there is an easy way to delete the invoice file after it is confirmed the email is sent to the mandrill service).
Thanks for any feedback!
Comment