• nmh
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

How to send Mass email in visual force. I developed a controller for vf page in which i can send mass email for user. This is working fine for standard email template. But when i use a custom email template id in settemplateId() , i am not able to recieve mail.

The code is as below :

public class testemail
{
User usr= [select Id from User where isActive = true limit 1];
String[] lstStr = new String[]{};


public testemail(ApexPages.StandardController controller)
{
//this.usr=(User)controller.getRecord();
}

public void SendEmail()
{
lstStr.add('shalabh.sharma@accenture.com');
lstStr.add('hemavathi.nm@accenture.com');
System.debug('This is to invoke this method');
system.debug('lstStr --->'+lstStr);
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setTargetObjectId(usr.Id);
mail.setToAddresses(lstStr);
mail.setTemplateId('00X90000000wpKN');
mail.setSaveAsActivity(false);
Messaging.SendEmailResult [] res = Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
system.debug('res--->'+res);
}
}

  • January 31, 2012
  • Like
  • 0

Hi,

I have 4 fields First Name, Last Name, Destination City, Destination State. These 4 columns have some duplicate values. I want to remove those Duplicate rows and these duplicate rows have different "Created Date".   have to delete only old dated rows. can someone help me. These records are already in database.

Lead IDCreate DateFirst NameLast NameDestination CityDestination State
00QU0000006ideK3/23/2008danramirez TX
00QU0000006idQI3/26/2008ErinJeffersReadingPA
00QU0000006igC03/25/2008ErinJeffersReadingPA

 

Thanks,
Uday

  • December 14, 2012
  • Like
  • 0

Hi there,

i'm implementing Salesforce2Salesforce for a customer. I'm using triggers on the receiving org to create the correct relationships (eg. when sending a single opportunity)

I managed to get this working, however it would have been much easier if i could enable debugging for the "Connection user" (the user that performs the actions on behalf of the shared connection) This is not possible using the normal monitoring.

 

Anyone have a good workaround?

How to send Mass email in visual force. I developed a controller for vf page in which i can send mass email for user. This is working fine for standard email template. But when i use a custom email template id in settemplateId() , i am not able to recieve mail.

The code is as below :

public class testemail
{
User usr= [select Id from User where isActive = true limit 1];
String[] lstStr = new String[]{};


public testemail(ApexPages.StandardController controller)
{
//this.usr=(User)controller.getRecord();
}

public void SendEmail()
{
lstStr.add('shalabh.sharma@accenture.com');
lstStr.add('hemavathi.nm@accenture.com');
System.debug('This is to invoke this method');
system.debug('lstStr --->'+lstStr);
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setTargetObjectId(usr.Id);
mail.setToAddresses(lstStr);
mail.setTemplateId('00X90000000wpKN');
mail.setSaveAsActivity(false);
Messaging.SendEmailResult [] res = Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
system.debug('res--->'+res);
}
}

  • January 31, 2012
  • Like
  • 0