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
Emine YumerovaEmine Yumerova 

button send email

Hello all 

Can somebody help me how to create a custom button  send email on Task object in Salesforce , 

But not with special template , I want to be available for all of the templates from the choosen Folder , 

I tried with this coding : location.replace('/email/author/emailauthor.jsp?retURL=/{! Task.Id }&p3_lkid={! Task.Id }&rtype=003&p2_lkid={! Task.Id }&template_id=<00X58000000EUn8>');

But I see error message.... casn somebody know what can I do ?
NagendraNagendra (Salesforce Developers) 
Hi Emine,

There is a way to send emails from a button. I don't know if this is the best option or exactly what you need but I can send emails by adding a button in the object I need to send the email from just by using this url:
/_ui/core/email/author/EmailAuthor?rtype=003&p3_lkid={!Case.Id}&retURL=%2F{!Case.Id}&p5={!$User.Email}&p24="AdditionalEmailAddresGoesHere&template_id=00X58000000sJE3
This is for the Case object but you can use it for the Task as well.
  • Got to Set up
  • Build
  • Activities -> Task Buttons, Links and Actions
  • Click in New Button or Link
  • Insert label name, select Detail Page Button
  • Behavior = Display in a new window
  • Content Source = URL
Insert this:
/_ui/core/email/author/EmailAuthor?rtype=003&p3_lkid={!Task.Id}&retURL=%2F{!Task.Id}&p5={!$User.Email}&p24="AdditionalEmailToSend&template_id=00X58000000sJE3
The last part of this link needs to point out to the email template you want to use for your email, so change the "template_id=00X58000000sJE3" to your template id. If you want to use this link in another button for another object you can do that by changing the parts in which you see "Task" for the object you want to use. I have tested this on the case and opportunity objects and works fine.

Let me know if it is also working for you.

Don't forget to add your new button to your custom button section in the pages you need to.

Thanks.
Nagendra
Emine YumerovaEmine Yumerova
Hi dear Nagendra,

Many many thanks for the advice and answer , 

I follow the instruction adding the button up to Task Pagelayout and  point out the template which we need to use after clicking on the button , 

but it does not work and it gives me a mistake/error.

What do you think is it my mistake maybe it is about the settings , but I really do not understand what does it mean and how to remove .

Thank you in advance again for time 
User-added image