Results 1 to 3 of 3

Thread: [EmailTemplate] Conditional statements and array fields in mail text

  1. #1
    helping is offline Member
    Join Date
    Jan 2011
    Posts
    8

    Default [EmailTemplate] Conditional statements and array fields in mail text

    Hi,

    I created an email template to use it as workflow email alert. I am facing two problems to which I found absolutely no information on the internet (which is quite unusual so I might have missed something...).

    The workflow triggers when a quote reaches a certain stage.
    The email contains information about the quote itself, billing account, billing contact, contracts, product bundles and products.

    Email template:
    Code:
    Hi,
    
    {if (true)}
    true test
    {/if}
    
    quote "{::future::Quotes::name::}" of customer "{::future::Quotes::billing_accounts::name::}" is ready for installation.
    
    Link to quote: {::href_link::Quotes::href_link::}
    
    Quote info:
    Bill to: {::future::Quotes::billing_accounts::name::} // {::future::Quotes::billing_contacts::full_name::}
    Ship to: {::future::Quotes::shipping_accounts::name::} // {::future::Quotes::shipping_contacts::full_name::}
    {::future::Quotes::description::}
    {::future::Quotes::assigned_user_name::}
    
    Contract info:
    {::future::Quotes::contracts::name::} // {::future::Quotes::contracts::start_date::}
    
    Product bundle:
    {::future::Quotes::product_bundles::name::} // {::future::Quotes::product_bundles::description::} // {::future::Quotes::product_bundles::total::}
    
    Products:
    {::future::Quotes::products::name::} // {::future::Quotes::products::description::} // {::future::Quotes::products::mft_part_num::} // {::future::Quotes::products::list_price::}; {::future::Quotes::products::deal_calc_usdollar::}; {::future::Quotes::products::discount_price::} // {::future::Quotes::products::quantity::} * {::future::Quotes::products::discount_amount::}
    
    Bye!
    Result (Example quote):
    Code:
    Hi,
    {if (true)}
    true test
    {/if}
    quote "testquote" of customer "Test Inc." is ready for installation.
    Link to quote: Click Here
     
    Quote info:
    Bill to: Test Inc. // Invalid Value
    Ship to: Test Inc. // Invalid Value
    My personal quote description
    John Doe
     
    Contract info:
    Contract Type X // 09.09.2008
     
    Product bundle:
    Group#2 // // 3.270,12
     
    Products:
    Product#7 // Product#7 detail info// // 200,00; 1,00; 200,00 // 3 * 0,000000
     
    Bye!
    So there are two problems I am trying to solve:
    • Empty fields are shown as "Invalid Value": How can I add some kind of "is empty" check? I tested the smarty syntax at the beginning of the mail text, but obviously the text is not handled as smarty template. Any chance to e. g. hide the contract section if no contract is added to the quote?
    • Some fields (contracts, product bundles, products) contain multiple records. However, only one record is printed. Is there a way to include e. g. the complete list of products?


    Any help or hints would really be appreciated.

    Regards,
    helping

    Using SugarPro 6.1.3 On-Premise

  2. #2
    helping is offline Member
    Join Date
    Jan 2011
    Posts
    8

    Default Re: [EmailTemplate] Conditional statements and array fields in mail text

    Any ideas on how to handle empty fields, array fields and/or conditions (e. g. gender differentiation) in email templates?

  3. #3
    abe.parvatiyar is offline Junior Member
    Join Date
    Mar 2011
    Posts
    1

    Default Re: [EmailTemplate] Conditional statements and array fields in mail text

    Hi,

    I am experiencing the same issue. Does anyone have any suggestions?

    The email which is sent back to me looks like this:


    ---------------------------------------------------------------------------

    Case Number: Invalid Value

    Subject: Invalid Value:



    Comment:

    Please clarify how 2 campaigns should be modified.


    By: Svetlana Sher


    Link to Case Invalid Value





    Any help would be greatly appreciated.



    Regards,

    Abe Parvatiyar

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 2010-04-08, 12:05 PM
  2. HowTo use Conditional fields for Subpanels ?
    By j.lagos in forum Developer Help
    Replies: 0
    Last Post: 2008-09-24, 02:40 PM
  3. Replies: 3
    Last Post: 2007-11-07, 02:28 PM
  4. EmailTemplate custom fields
    By eggsurplus in forum Developer Help
    Replies: 0
    Last Post: 2007-07-02, 07:19 PM
  5. Site studio - Custom fields - conditional field
    By zioigor in forum Feature Requests
    Replies: 0
    Last Post: 2006-11-24, 11:02 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •