Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Add a Email Template as a button on the Email form?

Posted on by 185

Hi,


Is it possible to add a button on the Email Form so that it goes straight to a particular Template? Without having to go via the Template button?


CRM 2013 - On Premise.

*This post is locked for comments

  • stuaz Profile Picture
    stuaz 185 on at
    RE: Add a Email Template as a button on the Email form?

    Ok kool thats better, but how do I get it so that the template is put in the body of the email? and then I can change the email (if I want to) and then click send.

    At the moment that just opens up the template to edit.

    I presume via Xrm.Utility.openEntityForm("template",id) ; but not sure how I put that in the JS ? Sorry!

    Thank you for your help so far though!

  • Royal King Profile Picture
    Royal King 27,686 on at
    RE: Add a Email Template as a button on the Email form?

    if you want to open particular email template pass template id in the url like below , replace guid with your template guid.

    /tools/emailtemplateeditor/emailtemplateeditor.aspx?id={DFD4FDF0-902E-450B-A4D6-71FEB7BD0B41}

    if you want to open just particular template you could use pass guid of the template in the below method

    Xrm.Utility.openEntityForm("template",id) ; 
  • stuaz Profile Picture
    stuaz 185 on at
    RE: Add a Email Template as a button on the Email form?

    Thanks! I was able to follow those brilliant instructions so thank you for that.


    So now when I press the button I get a screen which is a blank email template screen. How would I change it so that the button opened a particular email template related to the Case Entity?

  • Royal King Profile Picture
    Royal King 27,686 on at
    RE: Add a Email Template as a button on the Email form?

    THere is another tool called visual ribbon editor for crm 2011 to add custom buttons on the entity command bar  ,

    crmvisualribbonedit.codeplex.com

    Downlaod this tool and add button to your email entity using this tool

    I tested this in my server with following steps 

    1.Create javascript web resource file with below script

    function OpenTemplate(){
    var url = Xrm.Page.context.getClientUrl();
    window.open(url+ "/Tools/EmailTemplateEditor/Dialogs/emailtemplateproperties.aspx?isPersonal=0");
    }

    2. Open VIsual ribbon editor and connect your server 

    img3.png

    2.Once you connected choose email in dropdown

    1007.img5.png

    3. You will see below window once you click ok. THen click on "new Button" in the top 

    img6.png

    4.Give proper name to your button like below

    5126.img7.png

    5.click on action tab and choose javascript.

    5.2014_2D00_10_2D00_03_5F00_1227.png

    6.in the functionname enter your function name and in library choose the web resource that you created. Once this done save it .

    Save may take few minutes and once it completes open your existing email window there you will see your new button.

  • stuaz Profile Picture
    stuaz 185 on at
    RE: Add a Email Template as a button on the Email form?

    Ok, thanks. I have really only ever used the Workbench to hide buttons before so adding scripts to it is a bit new for me so I am just trying to work out where I can add the bits you have put in this thread.

    Its a Global template for Cases.

  • Royal King Profile Picture
    Royal King 27,686 on at
    RE: Add a Email Template as a button on the Email form?

    You are not changing anything on the email form , it just adds another button in the command bar just like "send" button.

  • stuaz Profile Picture
    stuaz 185 on at
    RE: Add a Email Template as a button on the Email form?

    Hi, thanks for your answer, will this still allow me to edit the email before its sent?

  • Royal King Profile Picture
    Royal King 27,686 on at
    RE: Add a Email Template as a button on the Email form?

    Add a custom button to email entity using ribbon workbench tool 

    http://www.develop1.net/public/page/Ribbon-Workbench-for-Dynamics-CRM-2011.aspx

    in the script use window.open to open email template window

    var url = Xrm.Page.context.getServerUrl();

    window.open(url+ "/Tools/EmailTemplateEditor/Dialogs/emailtemplateproperties.aspx?isPersonal=0");

    email template can be global or entity based, so if you want let user to choose template type like global or entity type you can use below url to open the window

    window.open(url+ "/Tools/EmailTemplateEditor/Dialogs/emailtemplateproperties.aspx?isPersonal=0");

    if you want to open email template for specific entity then you can use below url

    window.open(url+ "/Tools/EmailTemplateEditor/emailtemplateeditor.aspx?isPersonal=0&templateTypeCode=1");

    in the above url you need to replace templateTypeCode value based on which entity template you want to open . Im opening account specific email template in the above example.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans