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
JamesCoopeViconJamesCoopeVicon 

Visualforce email attachments

I am referencing a visualforce email template in a URL as below so it can be used in a detail page button.

/email/author/emailauthor.jsp?p2={!RMS_LicenseInfo__c.Contact__c}&p2_lki
d={!Contact.Id}&p3_lkid={!RMS_LicenseInfo__c.Id}&p26=support@vicon.com&t
emplate_id=00X300000011xl7


The attachment created by the template is not generated when the button is clicked.
If the template is selected manually then the attachment will appear.

Is there any way to make the attachment wok when the button is clicked?

Could I use Java or something?

Thanks,
James
mtbclimbermtbclimber
The mechanism you are using here is reliant on UI form parameters being stable. Salesforce provides no guarantee for this.  Your best bet is probably to create your own email form page. You can still leverage the Visualforce email template but will need to invoke the sendmail method in your Apex controller.
JamesCoopeViconJamesCoopeVicon
For anyone who has the same issue I have fond the answer after a little more digging...
you need to use &new_template=1 in the URL to get attachments from the template itself!




Message Edited by JamesCoopeVicon on 12-08-2008 02:09 AM