• skompolt
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
The following query is not resulting with the Contact Id...

if (!$mylogin) {
        echo "ERROR connecting to SFDC fetch_record.";
       print_array($mySforceConnection -> result);
        return null;
    } else {
        $query = "Select Id, LastName,  FirstName, Email FROM Contact  where Email ='".$email."'";

        $response = $mySforceConnection->query($query);
        foreach ($response->records as $record)
        {
            $contactId =  $record->Id;
       }
       echo "Results of query $query <br/><br/>\n";
       echo "Contact =$contactId<br/><br/>\n";
       //echo "Results of response '$response->Id.' <br/><br/>\n";
        return $response["records"]->values;
    }
I have created a table to house basic information for putting into an email (subject, intro etc). I will call this EMAIL. I have created a child table to house the content for emails, so each EMAIL object can have one or more CONTENT objects.
I have created a many-many relationship between CONTACT and EMAIL via another table called LINK.
I have two email templates. One is 'Custom' and as follows. This works fine, when I trigger it (by adding a LINK object),  I get an email send to my Contact with both the expected merge fields filled in.
Dear {!CONTACT.FirstName}, Intro: {!EMAIL__c.Introduction__c}
However, I have a second template created using Visualforce (below). If I switch my email alert to use it instead, then perform the same action to get the email to be sent to a Contact, neither the Contact's Name or the EMAIL Introduction is merged in! Also note that, if I use this template and 'Send Test and Verify Merge Fields', entering my Contact and EMAIL ID causes the merge from both objects to work perfectly! Can anyone offer any advice?
Thanks
<messaging:emailTemplate recipientType="Contact"
    relatedToType="Queued_Email__c"
    subject="ed test 3">
    <messaging:htmlEmailBody >
        <html>
            <body>
            <p>Dear {!recipient.name},</p>
            <p>{!relatedTo.Introduction__c}</p>
            </body>
        </html>
    </messaging:htmlEmailBody>
</messaging:emailTemplate>
 

Hi,

 

The online help seems to suggest that only standard objects are support for visualforce EMAIL templates.

 

<messaging:emailTemplate recipientType="Contact"
    relatedToType="Vacancy__c"
    subject="Test"
   
    replyTo="support@acme.com">

    <messaging:htmlEmailBody >
        <html>
            <body>

            <p>Dear {!Vacancy__c.Name},</p>
       
            </body>
        </html>
    </messaging:htmlEmailBody>
</messaging:emailTemplate>

Going to switch to full HTML if this is not supported.

 

Thanks 

 

Hi,

Can we create Bar charts in visualforce email templates?

 

Please let me know if this is feasible.

 

Thanks.

 

--Asif

  • July 02, 2010
  • Like
  • 0