Insert Opportunity variables into Email Templates

I'm trying to create an Email Template for use in the Opportunities module, but the only variables that are available are from the Contacts,Lead,Target,Accounts,User, and Current User modules.

Is there a way to add modules to use variables from?

Thanks!

SugarCRM Enterprise 7.9.2.0 - On Premises

  • Hi @Hats! This article really did help me alot but after doing everything I'm getting the error 

     {SugarClub Administrator Edit: We're sorry, but this image is no longer available}  

    yes I override the bean class just as you did after that I got this error. Before overriding the bean class I was able to get case module in insert variable but not its fields. Can You help me with this? Will be grateful  

  • Hi Hijab Fatima,

    Are you getting this error while overriding email template bean? Which version of sugar you are using?

    Would you mind sharing your code here for us to look into.

    Regards.

    Hats

  • This post may be a little old now, and seems to have content missing, i.e. images, possible when the forum was transferred to the new platform.

    Has anyone been able to make other module fields available to the Email Template? I'm currently running SugarCRM Version 11.0.0 (Build 238 P) (Q2 2021). I would like to be able to access fields from the Quotes Module. 

    I have followed the above instructions as best I can with the missing details. 

    If there is a more details and complete list of details, I would appreciate the help. Thanks again. 

  • Sorry, I didn't get the notification on your reply.

    I don't think you need to do a custom modification anymore. Without any modification to the system, try composing an email from a Quote record and use:

    $quote_<fieldname_in_studio>

    in the body or subject of the email. For example, if you'd like to pull the Quote's Name for use in the email subject:
    This is the subject for $quote_name

  • Hi John, 

    Many thanks for your reply. Yes this method does work.

    However I have a number of fields that are derived from relationships in the Quotes module e.g. 

    Name

    Type
    billing_account_name Relationship
    billing_contact_name Relationship

    The relationships within the Quotes module are below: 

    Name Primary Module Type Related Module
    quotes_billto_accounts Accounts Many to Many Quotes
    quotes_contacts_billto Contacts Many to Many Quotes

    For some reason the method of

    $quote_<fieldname_in_studio>

    does not work for the related fields. I have tried a few combinations of the relationship name etc, however I don't seem to be able to get these details. 

    I can cheat and create a Calculated Custom Field that is the related field e.g. 

    related($billing_accounts,"name")

    And then use the calculated custom field, e.g. 

    $quote_calculated_account_name_c

    Do you know if it is possible to use a related field as an email variable?

    Thanks again for your help