• InsightTeam
  • NEWBIE
  • 55 Points
  • Member since 2012

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies

Why is salesforce adding an image tag to dynamically generated HTML email? It's causing us issues (Outlook).

 

Here's very simple code to with HTML generated content:

Messaging.Singleemailmessage mail;
mail = new Messaging.Singleemailmessage();
mail.setSubject('TEST 123');
mail.setHtmlBody( '<html><h1>THIS IS JUST A TEST</h1></html>');
mail.setSaveAsActivity(false);
mail.setTargetObjectId(UserInfo.getUserId());
Messaging.sendEmail(new List<Messaging.Singleemailmessage> {mail});

 When i execute this, it adds an image tag right before the closing HTML (</html>).

 

How to workaround this? Why is this?

 

Thanks

 

 

Hi,

 

I wanted to know if i could create hyperlink to a particular record by just having id as information. 

For example, if i did a SOQL query for ids of all accounts:

 

List<id> accids = [SELECT id FROM Accounts];

 

for (id accid :accids)

{

    for each id i need to create a hyperlink and store it as a string. 

    then display it on VF page

}

 

The issue that not all orgs has the same starting URL?

Any suggestion?

 

Thanks

 

 

  • April 18, 2013
  • Like
  • 0

I have an Apex class in which an html email is constructed and then sent out.  I want to track this email through HTML Email Status Reports but the 1x1 image is not being included.  Is there a way to include the web beacon in my Apex Class generated html email?

We have a class that grabs specific attachments and sends them out along with a proposal as an email.  This has worked fine for the last 8 months since the code was written.  I know salesforce did an update over the weekend and since then we are getting the following error everytime we try to click the custom button in Opportunities to send out the proposal:

 

Maximum view state size limit (135KB) exceeded. Actual view state size for this page was 139.656KB 

 

I do have some programming experience - just not in Apex so this might be something I can handle with the right direction.  Basically to sum it up, the code grabs specific attachments, an intro letter and some details from the opportunity and sends an email.  This has been resolved by adding:

 

transient Blob fileBody;

 

Why is salesforce adding an image tag to dynamically generated HTML email? It's causing us issues (Outlook).

 

Here's very simple code to with HTML generated content:

Messaging.Singleemailmessage mail;
mail = new Messaging.Singleemailmessage();
mail.setSubject('TEST 123');
mail.setHtmlBody( '<html><h1>THIS IS JUST A TEST</h1></html>');
mail.setSaveAsActivity(false);
mail.setTargetObjectId(UserInfo.getUserId());
Messaging.sendEmail(new List<Messaging.Singleemailmessage> {mail});

 When i execute this, it adds an image tag right before the closing HTML (</html>).

 

How to workaround this? Why is this?

 

Thanks

 

 

Hi,

 

I created this trigger:

 

trigger CriarTarefa_Produtos_Cobranca on Task (after update) {

    List<Task> taskProd = new List<Task>();
    for (Task tt : Trigger.new)
    if (tt.subject == 'Cobrança - Problemas com produtos' && tt.status == 'Concluído' || tt.subject == 'Cobrança - Pergunta não solucionada' && tt.status == 'Concluído'){
                taskProd.add (new Task(
                         Subject = 'Cobrança - Questão solucionada?',
                         Status = 'Nenhum',
                         WhatID = tt.WhatID,
                         Description = tt.description,
                    	 OwnerId = '005U0000001KrXY',
                         ActivityDate = Date.today()));
 }

    for (Task tt : Trigger.new)
    if (tt.subject == 'Cobrança - Questão solucionada?' && tt.Quest_o_solucionada__c == 'SIM' && tt.status == 'Concluído'){
                taskProd.add (new Task(
                         Subject = 'Cobrança - Feche o chamado e notifique o formando',
                         Status = 'Nenhum',
                         WhatID = tt.WhatID,
                         Description = tt.description,
                    	 OwnerId = '005U0000001KrXY',
                         ActivityDate = Date.today()));
 }
    for (Task tt : Trigger.new)
    if (tt.subject == 'Cobrança - Questão solucionada?' && tt.Quest_o_solucionada__c == 'NÃO' && tt.status == 'Concluído'){
                taskProd.add (new Task(
                         Subject = 'Cobrança - Pergunta não solucionada',
                         Status = 'Nenhum',
                         WhatID = tt.WhatID,
                         Description = tt.description,
                    	 OwnerId = '005U0000000FrCz',
                         ActivityDate = Date.today()));
 }
                insert taskProd;
            }

 And my test class:

 

@IsTest(SeeAllData=true)
public class CriarTarefa_Pendencia_Duomind_test{
static testmethod void MyUnitTest(){
    
 
     User u = [select id from User where LastName='Marketing'];
      
     Case c = new Case (recordtypeid='012U000000011yC');
    
     Task tsk  = new Task(Status='Não iniciado', Priority='Normal', subject='- Iniciador do Fluxo -');
     insert tsk;
 
    tsk.Status = 'Concluído';
    update tsk;
}
}

 

My code coverage is in 74%.

What I'm missing here?

 

Any help?

 

Thanks !

Hi,

 

I wanted to know if i could create hyperlink to a particular record by just having id as information. 

For example, if i did a SOQL query for ids of all accounts:

 

List<id> accids = [SELECT id FROM Accounts];

 

for (id accid :accids)

{

    for each id i need to create a hyperlink and store it as a string. 

    then display it on VF page

}

 

The issue that not all orgs has the same starting URL?

Any suggestion?

 

Thanks

 

 

  • April 18, 2013
  • Like
  • 0