Design an Email Template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kumaresan
    Junior Member
    • Aug 2018
    • 18

    Design an Email Template

    Its a Simple, still i'm asking help me with a example pls

    I have Account and 10 contacts with Status as Active / Inactive

    I need to create a email template for each account, with only active Contact details in a tabulor form with fields Name, Contact Number, Status or in some cases, list all contacts under a Account.

    Once i have a template, then i use it on Workflow with filter to send email !

    Link this

    Dear User,

    Please find the Contacts under your Account Name bellow
    Name Contact Number Status
    Name 1 1234567890 Active
    Name 2 1234567852 Active
    Thank you
    Last edited by kumaresan; 12-16-2024, 01:31 PM.
  • victor
    Active Community Member
    • Aug 2022
    • 728

    #2
    kumaresan,

    Beginning EspoCRM v.9.0.0

    You can use the following code for your Email Template (you can also change the styles yourself) for Account, Contacts whose status is Active:

    HTML Code:
    <p>Please find the Contacts under your Account Name bellow</p>
    <p></p>
    <table style="border: 1pt; border-spacing: 1pt; border-collapse: collapse; width: 100%;" cellpadding="4" border="3pt">
    <tbody>
    <tr>
    <th width="35%" align="left">Name</th>
    <th width="35%" align="left">Contact Number</th>
    <th width="30%" align="left">Status</th>
    </tr><tr x-if="{{equal status 'Active'}}" iterate="{{contacts}}">
    <td>{{name}}</td>
    <td>{{phoneNumber}}</td>
    <td>{{status}}</td></tr>
    </tbody>
    </table>
    <p></p>
    For Contacts whose status is Inactive (for second Email Template), replace the line:

    HTML Code:
    </tr><tr x-if="{{equal status 'Active'}}" iterate="{{contacts}}">
    to
    HTML Code:
    </tr><tr x-if="{{equal status 'Inactive'}}" iterate="{{contacts}}">
    More about iterate attribute: https://docs.espocrm.com/user-guide/...#each-iterator
    More about Conditional rendering attribute x-if: https://docs.espocrm.com/user-guide/...attribute-x-if

    A special request is not to create more than one topic with the same request, like this one: https://forum.espocrm.com/forum/gene...-email-summery

    Comment

    • kumaresan
      Junior Member
      • Aug 2018
      • 18

      #3
      victor Thank you and I appriciate your Efforts; I will definetly Try and share my experience.
      you mentioned Version 9.0; Current Release at ESPO Website is 8.4.2; Will this code will work now as well ?

      Comment

    • victor
      Active Community Member
      • Aug 2022
      • 728

      #4
      It is better to wait for EspoCRM 9.0.0.

      You can try testing on EspoCRM 8.2.4: not for the Email Template, but for the PDF Template (based on the Account entity).
      The fact is that on EspoCRM 8.2.4 for the Email Template the code I proposed is not saved quite correctly, but for the PDF Template - everything is ok.
      So, you can design your template (styles, font, etc.) on PDF Template​, and when EspoCRM 9.0.0​ is released, just transfer the code to Email Template​.​
      Last edited by victor; 12-18-2024, 10:26 AM.

      Comment


      • conceptmedical
        conceptmedical commented
        Editing a comment
        victor, I have checked the same, Its working fine in PDF. but the requirement is for email template to push the item details in email body.

      • victor
        victor commented
        Editing a comment
        conceptmedical

        I wrote about this in the previous post. Please wait for EspoCRM 9.0.0.
        Last edited by victor; 12-21-2024, 01:58 AM.
    Working...