show real values in (draft) email - data fields


Is it possible to show the actual values in the email before sending the email to a client. Meaning:

When I click on the email address->choose a template, the draft email will show up with the data fields “$contact_first_name $contact_last_name”

i,e, I would like the $contact_first_name $contact_last_name to show up as the real names. It does get converted correctly once the email is sent, but it would be great to see it, before sending the email.

is this possible ?

No, I don’t think it’s possible…

You could try setting up a separate scheme with the “Generate letter” feature, which produces PDF’s from the PDF templates module. but it would be a duplication of what you already have. Still, it might be useful for some checks.

Well if you are into customizing, you could do something like this:

Create a new view for example: view.preview.php

You would need to post the Contact Id to that view, for example, selecting it from a dropdown from all of your contacts. Also you would need to select an ID for an template. Code below is not functional but it could give you some help to achieve what you’re trying to.

class MODULEViewPreview extends SugarView
    public function display()
        $ss = new Sugar_Smarty();
        $contact = new Contact();
        $template = new EmailTemplate();


        if ($template->text_only) {
            $template->subject = $template->parse_template_bean($template->subject, $contact->module_dir, $contact);
            //Parse Body
            $template->body = $template->parse_template_bean($template->body, $contact->module_dir, $contact);
        } else {
            $template->subject = $template->parse_template_bean($template->subject, $contact->module_dir, $contact);
            //Parse Body
            $template->body = $template->parse_template_bean($template->body_html, $contact->module_dir, $contact);
        $ss->assign('template_subject', $template->subject);
        $ss->assign('template_body', $template->body);

And in your preview.tpl

 <div id="template">
1 Like

Hi and thanks

Thanks, I did manage to get the generate letter (pdf) to work, (but its an extra step). I actually like the suggestion of activist the most !

antivist: could you perhaps share your email adress with me ? mine is