sending email notifications with file attachments in IBM CLM
3 answers
I doubt this is possible. There are Email templates, but they do not allow attachments. RRDI (If available) can be used to run reports on a schedule and can send them out via e-mail.
Comments
In your question, it sounds like you want to automatically generate an email notification to a specific person, when you attach a file to a work item, and you want that email to contain that file attachment. Is that correct? In your comment above, you indicate that a link to that file would be sufficient (i.e. that it is OK for the email to contain a URL link to the attached file, rather than actually contain the file). Is that correct?
If so:
- Add that specific person as a subscriber to the work item
- Have that person indicate in their RTC profile that they want to receive email notifications
- Every time you add an attachment to that work item, also add a comment containing the URL of the new attachment.
- That person will automatically get email with a link to the attachment.
If so:
- Add that specific person as a subscriber to the work item
- Have that person indicate in their RTC profile that they want to receive email notifications
- Every time you add an attachment to that work item, also add a comment containing the URL of the new attachment.
- That person will automatically get email with a link to the attachment.
RTC provides below API in IMailerService to send mulitpart email messages -
I suppose this would serve the purpose.
public void sendMultipartMail(MailSender sender, String toAddress, String subject, Multipart msg, String cc) throws MessagingException;I have used the same API to attach a file into email. Below is the sample code for same -
// Create a multipart message
Multipart multipart = new MimeMultipart();
// Part1 is plain text. Create the plain text message and add into multipart
BodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setText("Mail text Content");
multipart.addBodyPart(messageBodyPart);
// Part two is attachment, add that too into multipart
messageBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource("/tmp/my_attachment");
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName("AttachmentName");
multipart.addBodyPart(messageBodyPart);
mailerService.sendMultipartMail(mailerService.getDefaultSender(), "test@gmail.com",
"subject", multipart, null);
I suppose this would serve the purpose.