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
B2000B2000 

Event Button the Populates a VF Email Template Using PE

I can't seem to create an Event Button that populates a VF Email Template with event details using Professional Edition.

 

.  Here is the button.

 

"/_ui/core/email/author/EmailAuthor?p2_lkid={!Event.Who}&p3_lkid=&p4=&p5=&p24=&cancelURL=/{!Event.Id }&retURL=/{!Event.Id}&template_id=00XA0000000eyxo&recipient_type_id={!Event.Who}&related_to_id={!Event.Id}"

 

Putting the p3_lkid={!Event.Id} produces an error "Invalid parameter" due to the EmailAuthor doesn't seem to allow Events as a valid p3_lkid.

 

Here is the VF Email Template.

<messaging:emailTemplate subject="Appointment Confirmation" recipientType="Contact" relatedToType="Event">

<messaging:htmlEmailBody >
<p>Dear {!recipient.Name},
<br/>
<br/>
This is a reminder of an appointment that is scheduled.  Details are:
<br/>
<br/>
Appoinment: {!relatedTo.Subject}
<br/>
<apex:outputText value="Date: {0,date}">
<apex:param value="{!relatedTo.StartDateTime}"/>
</apex:outputText>
<br/>
<apex:outputText value="Time: {0,time,short}">
<apex:param value="{!relatedTo.StartDateTime}"/>
</apex:outputText>
<br/>
Company: {!relatedTo.What.Name}
</p>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

 

The template populates fine when using the Send Test and Verify Merge Fields, but not using the button.  Any ideas?

Thanks.

Ispita_NavatarIspita_Navatar

Sorry it was a bit ambiguous- were you not able to create the button? Or you were able to create the button and the functionality didn't work as you expected.

Please do clarify? Have you checked it is not because of you using a professional edition though I think there is to limitation on creation of custom buttons in PE (professional Edition).

Fra08Fra08

Hello,

 

here you have some answers:

 

https://sites.secure.force.com/blogs//apex/ideaList?c=09a30000000D9xo&sort=recent

 

In this link they say to add at the end the parameter  "new_template=true"

 

this is my button:

 

location.replace('/email/author/emailauthor.jsp?retURL=/{!Case_Study__c.Id}&rtype=00Q&template_id=00X20000001L1H7&new_template=true') 

 

 

B2000B2000

The button when clicked produces this error message: "Invalid parameter value "00UA0000003GsSc" for parameter "p3_lkid".  Adding the "&new_template=true" parameter produces the same error message.  It appears the email author does not allow a p3_lkid with an event Id.  However, when using the Send Test Email and Merge Fields with this VF Email Template using a contact and event Id, it populates and sends the email correctly.  It doesn't use the email author.  So, is there a way to create a URL (to be used in a button) that can access the send email portion of the Send Test Email and Merge Fields with the relatedTo and recipient prepopulated?  Bottom line, how can a PE user create a button to on an Event to send an email to a Contact (listed on the event) using details of that event?

sbajasbaja

Hi,

 

have you got any solution to this?

Instead of trying it through a button , I am trying that through a trigger.

But facing the same issue,

Similarly when send test through the test mail, it populates all the fields but give exception when trying it through trigger.

 

Thanks n Regards

sbaja

Sri KrishnamurthySri Krishnamurthy
Hi, you got any solution for this, exactly into this problem now!