Attach a file in an email trigger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Attach a file in an email trigger
Does anyone know if its possible to take a file from an attachment field and attach it in an email through a trigger?
- Tags:
- trigger_api
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi David,
in the JS triggerscript I'd try to fetch the ScriptAttachmentBean via the ScriptIssueBean (or ScriptIssueDeltaBean depending on your trigger context).
The ScriptAttachmentBean offers a getContent() method, that seems to represent the actual attachment file.
The rest depends on your email setup.
HTH Matthias
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi David,
Did Matthias suggestion help?
This feature is not something built into the core product, and would definitely require the use of Trigger API calls to achieve. I do know that some customers have implemented this behavior.
Services could certainly do this sort of functionality for you.
Regards,
Kael
Kind Regards,
Kael Lizak
Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I'm using the attachment bean to get the content but am not sure how to get that into the email.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Are you using the sendEmail class?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I'm using the stanard function MKS uses in their triggers Packages.javax.mail. My first problem was I was using getAttachmentBeans instead of getAddedAttachmentBeans. So I'm able to get the attachment, save it to disk through FileOutputStream and then send it.
So it'd be nice to save to disk part but I don't know if that's possible.