Results 1 to 4 of 4

Thread: Send custom fields Data via Email

  1. #1
    crmnovice is offline Senior Member
    Join Date
    May 2009
    Posts
    25

    Default Send custom fields Data via Email

    Hello,

    We are able to utilize an after_save logic hook to send data fields via email successfully. This is accomplished using the following function which provides the entire main table (example: the “Contacts” table) fields to the PHP script:

    Code:
    function send_email(&$bean, $event, $arguments) {
    Within the script we can then reference the user’s first name, by using the respective bean:

    Code:
    {$bean->first_name}";
    However, this only works for the main table fields, and does not allow us to use fields found within the custom table (example: the “Contacts_cstm) table.

    Does anyone know how to reference (use) fields from a custom table (*_cstm), when sending email messages (via logic hook)?

    Thank you!

  2. #2
    chinwoei's Avatar
    chinwoei is offline Sugar Community Member
    Join Date
    Jul 2007
    Posts
    91

    Default Re: Send custom fields Data via Email

    Quote Originally Posted by crmnovice View Post
    Hello,

    We are able to utilize an after_save logic hook to send data fields via email successfully. This is accomplished using the following function which provides the entire main table (example: the “Contacts” table) fields to the PHP script:

    Code:
    function send_email(&$bean, $event, $arguments) {
    Within the script we can then reference the user’s first name, by using the respective bean:

    Code:
    {$bean->first_name}";
    However, this only works for the main table fields, and does not allow us to use fields found within the custom table (example: the “Contacts_cstm) table.

    Does anyone know how to reference (use) fields from a custom table (*_cstm), when sending email messages (via logic hook)?

    Thank you!

    Hi,

    I faced the problem before while all the custom fields data inside $bean/$focus will be unset after saving the record.
    You may try to comments out the unset in modules/DynamicFields/DynamicField.php function save() and search for unset($this->bean->$name).
    After comment out this line, you should able to retrieve custom fields data.
    I am from iZeno Pte Ltd
    Personal Site: Technical Sharing
    SugarForge Project:
    iZeno SMS : http://www.sugarforge.org/projects/izeno-sms/

  3. #3
    crmnovice is offline Senior Member
    Join Date
    May 2009
    Posts
    25

    Talking Re: Send custom fields Data via Email

    Thanks for your reply chinwoei. However that approach did not work for me.

    Does anyone else know how how to send custom field values via email? We already have the logic hook working to send the email, and am trying to figure out how to include the value for a custom field (fieldname_c), within the email message.

    Thank you!
    Last edited by crmnovice; 2010-07-06 at 09:59 PM.

  4. #4
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Send custom fields Data via Email

    Hi,

    After save logic hook doesn't provide custom fields.

    Try below code,

    PHP Code:
    $bean->custom_fields->retrieve(); 
    $custom_field $bean->CUSTOM_FIELD_NAME
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Custom fields will not hold data
    By Compguy29 in forum Help
    Replies: 10
    Last Post: 2010-04-05, 06:01 PM
  2. Replies: 1
    Last Post: 2009-09-23, 01:35 AM
  3. Custom fields don't save any data
    By eringuet in forum Help
    Replies: 21
    Last Post: 2008-04-17, 07:38 AM
  4. Custom fields data
    By major__tom in forum Help
    Replies: 3
    Last Post: 2006-01-23, 09:10 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
  •