function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
rachvillrachvill 

custom email scontrol with attachment

Hi,
 
I'm trying to create a custom email scontrol. I use emailauthor.jsp to send the email. However, I am having a hard time figuring out how to send an email with file attachments. I looked at source code for the built-in email page, and it uses filepicker_fs.jsp when you click the Attach File button. There are a couple of parameters that are being passed in this jsp page. I'm not really sure what each parameter is for. I've been trying to figure it out. I also don't even know how to pass the files back to the email, before it actually get sent.  I think it uses emailattach.jsp. And again, I really have no idea how it works.
 
Has anybody been able to create an scontrol with similar requirement as mine? If so, I would really appreciate it if anybody can point me at the right direction.
 
Thank you.
 
Rachel
 

 

Ron HessRon Hess
it's tricky, yes and not documented or supported, but emailauthor can send an email template , the template can have an attachment.

this limits you to one attachment for each template, but it is possible to specify the template when calling emailauthor

would that work for your use case ? ( one email template and it's attachment for all outgoing?)

rachvillrachvill
Hi Ron,

Thanks for the prompt reply. Email template will have to do then.

Rachel
gsickalgsickal
Is it possible to programmatically change the attachment stored with the template before sending the email?  So for example I could indirectly include an attachment stored with the case object in your Case History scontrol example...
DevAngelDevAngel
If the attachment field is exposed on the EmailTemplate object and the EmailTemplate object and the attachment field are updateable, then I don't see why you couldn't.
gregsgregs
 Is there an example of this somewhere (sending an attachment with an scontrol)  what i specificially need to be able to do is specify the attachment id at runtime so one way if possible would be to create an email template through the api and specify an attachment to use with this template...
Rajesh ShahRajesh Shah

Can you please help to answer to following post by me  - Attaching a File from SControl
http://community.salesforce.com/sforce/board/message?board.id=ajax_toolkit&message.id=6061

Thanks in Advance