My problem
I want to create an email template which has a dynamic footer. The dynamic footer has the contactinformation of the person sending the message.
When I'm creating a template I can use the Insert Variable drop-down to insert the right placeholders. The problem is that when the message is send the content of the placeholders is filled with the information of the “record owner” not of the one sending the message.
Why not use the signature?
But you can use variable signatures for each employee you might say, which is true. The problem is that when "Signature above reply" = true, it puts the sig above the template, which is not what I want. Furthermore I have to maintain a sig for everybody in the company.
Possible solutions
So there are two possible solutions.
- When the mail is not a campaign match the sender not the record owner
- When creating a message using a template, place the signature under the template. (select template, select sig). Or place the sig on the location of the cursor.
I favour the first option (matching).
My question?
Which file do I have to edit to create the “match the sender not the record owner” functionality?
Might this be a good addition to sugarCRM?
(currently using sugar crm 6.1.3 community edition)
Ok i found the file:
/modules/EmailTemplates/EmailTemplates.php
Code:
if(!empty($focus->assigned_user_id)) {
$user = new User();
$user->retrieve($focus->assigned_user_id);
$repl_arr = EmailTemplate::_parseUserValues($repl_arr, $user);
}
} elseif($bean_name == 'Users') {
/**
* This section of code will on do work when a blank Contact, Lead,
* etc. is passed in to parse the contact_* vars. At this point,
* $current_user will be used to fill in the blanks.
*/
$repl_arr = EmailTemplate::_parseUserValues($repl_arr, $current_user);
etc The second part selects the current user so if you want this you can replace:
Code:
$repl_arr = EmailTemplate::_parseUserValues($repl_arr, $user);
with:
Code:
$repl_arr = EmailTemplate::_parseUserValues($repl_arr, $current_user);
But it's a dirty hack. It should determine if it's a campaign or a single message send directly and than select the right user.
Bookmarks