1.2k questions
1.4k answers
361 comments
339 users
Keep getting the following error while trying to utilize the qie.sendEmail function.
ClassCastException: Cannot cast java.lang.String to java.util.Map
This is caused when you pass a string as the final paramater for the qie.sendEmail() function instead of an emailAttachmentMap.
You need to create an emailAttachmentMap and then add your attachments to this map before calling the qie.sendEmail(). Once you have done this, you will pass the emailAttachmentMap as the final paramater in the call.
var attachmentMap = qie.newEmailAttachmentMap(); qie.addEmailAttachment(attachmentMap, 'file.name', source.getBytes()); qie.sendEmail('email@host.com', 'test attachment', 'here is the attachment', attachmentMap);
See: https://www.qvera.com/kb/index.php/470/can-i-email-an-attachment-in-a-channel