Email services are automated processes that use Apex classes to process the contents, headers, and attachments of inbound email.

learn more… | top users | synonyms

0
votes
0answers
22 views

SingleEmailMessage not working

I tried this code in anonymous apex and I did not get an email. List<String> oid_updated = new List<String>{'1','2','3','4','5'}; Messaging.SingleEmailMessage mail = new ...
0
votes
1answer
34 views

how to extract and show signature in vf detail page?

this code is working and view all the data on my vf detail page but i want to extract signature like this is my mail hello salesforce -- Thanks and regards Vipin Indora mob no- 1234567890 i want ...
0
votes
1answer
16 views

Apex: if condition for if email has bounced or unconfirmed address

Is there something against a Lead I can query to see if email sent from Salesforce has bounced or if the email address needs confirming? Can't find anything in the docs. Thanks!
1
vote
1answer
27 views

Batch Job-Mass email Contacts

I have a batch job that emails contacts using a visualforce template. I am using SingleEmailMessage to email contacts as the template pulls data from each contact. my batch size is 10 and we have ...
1
vote
3answers
33 views

Mass email the Visualforce email template

We have a limitation using Visualforce email template. VF Email Template can't be used for mass email. I am look for the ways how this can be achieved. I have created a visalforce email ...
1
vote
0answers
16 views

will there be a delay in sending email for different id's

I have two contacts for which the email id's are say 123@abc.com for contact1 amd 234@xyz.com for contact2. When I send Email Message to 123@abc.com, I'm getting the email immediately. Whereas the ...
0
votes
2answers
23 views

Apex: HTML email status to get open count

I'm writing some Apex to list how many times a certain email has been opened. How can I access the "HTML Email Status" object from the lead? List<Lead> leads = [SELECT Id, Email, (SELECT Id, ...
1
vote
2answers
31 views

Any issue if too many future calls are set

I am sending email from my apex code using sendgrid API and after every call I am updating a flag in my object marking that email is sent. I am doing DML after every callout because somehow any error ...
0
votes
1answer
16 views

Apex: access lead email history to prevent resending

Can I access a lead's email history in Apex to see if they've already been sent an email from a timeframe/template combination? Or even something arbitrary like the email subject? public void send() ...
0
votes
0answers
16 views

Email Service : Emails not getting to my instance

Email service is working fine using outlook with attachment but fails when using a custom application. Can somebody please let me know how to debug to check further.Is there any email configuration ...
3
votes
2answers
45 views

How to know current Email governor limits?

I am using SingleEmailMessage api for sending emails. I want to know the email limit quota usage, so that I can prevent further exceptions. Is there any way to know the quota usage in apex, so that I ...
1
vote
0answers
46 views

Get Email Body with HTML Tags

I want to send an email in my logic. I have created an Email Template. Here is what I want to achieve: Email Template: <html width="600px"> <style>body{font-family:"Helvetica ...
0
votes
0answers
15 views

How to use Email Service addresses for Inbound?

I am attempting to use the Email Service address for Replies to certain Email Alerts. But we are unable to use Email Service addresses as Org-Wide addresses, and therefore we cannot use them as the ...
0
votes
1answer
23 views

Multiple email attachment failure

I have below code to send multiple email attachments in a single email which is throwing below error. Can some one please tell me what's wrong here? Code Snippet Messaging.EmailFileAttachment efa = ...
0
votes
0answers
20 views

Edit Email Template during the run

Can someone let me know how to replace "{!Compliance_Incident_abv__c.RepEmail_abv__c}" here with a parameter value passed to the method (not Using REGEX if possible)? I have an email template with ...
0
votes
1answer
112 views

Fail to send email by utility class

I have below utility class which throws error as this in debug log. Error INVALID_FIELD_WHEN_USING_TEMPLATE: When a template is specified, the plain text body, html body, subject, charset, and ...
0
votes
1answer
53 views

Sending mass emails in Salesforce using SendGrid or MailChimp

I am working on Salesforce App where there is a custom object named Distributor (Distributor__c). A distributor has primary email address as one of the fields. When a new distributor record is added ...
-1
votes
1answer
24 views

Regex expression [closed]

Can someone let me know regex expression for below? I have an email template with below text. Template Body Dear {!Compliance_Incident_abv__c.RepEmail_abv__c}, What you need to know: New ABS ...
0
votes
1answer
45 views

List<Messaging.SingleEmailMessage> + Lightning component - Sending emails from a lightning component

I am getting an error message that the email messaging method is not enabled for Aura components. Need sone help if I am going in the right direction or not. Thanks!
0
votes
0answers
30 views

close case object

how we can implement auto closing in case object ? The scenario is to get the cases closed automatically if the status remains the same for certain hours. What option we can use to implement this ...
0
votes
1answer
30 views

Reply to an outbound email sent from a Case record create a new case, as opposed to attaching to the Case in which the email was sent?

I am using sales force email services and email to case . It works fine for routing email , But when I used OWD email addresses and an outbound email , Then on user reply it results in creating a new ...
0
votes
1answer
64 views

Case's Ref ID or Thread ID when using Email Services with ORg wide email addresss creating new case on replying

I have enabled email services in salesforce , An was trying to use threadID for the reply. Although what i have found is that the routing address added in the email to case setting are working fine ...
0
votes
1answer
38 views

Fields related to my web service in the generated WSDL file not coming

I have a web service class and I need to generate WSDL . When I click button it is generating wrong WSDL. I don't see any of the fields related to my web service in the generated WSDL file. ...
1
vote
1answer
32 views

How to write unit tests for emails being sent via Apex?

If I send an email via Apex Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); mail.setTargetObjectId(someContactId); mail.setTemplateId(someTemplateId); ...
0
votes
2answers
19 views

Email body issue

I have tried to form the email body of a singleemail message as below but it is giving Line break errors. Can someone help me here? String body = 'Dear ' + OneMap.get(mycontact.ID).Rep_abv__r.Name + ...
0
votes
1answer
54 views

if we can use Email Services instead of Email-to-Case, but still use the Ref ID/Thread ID

Email Services addresses do not show up when selecting the FROM drop-down when sending an email from a case record. Therefore, it does not allow us to use the Thread ID or Ref ID, which means our ...
0
votes
1answer
102 views

How to create a new record from a CSV file attachment processed by the email service in salesforce

My requirement is that I need to create new records / update existing records based on the data from an email attachment consisting of .csv file format that is parsed to the Email Service that I've ...
3
votes
1answer
17 views

Pulling PDF email attachment fields into Salesforce fields using Email Services

I am currently using Email Services as a way to have a customer's email update certain fields in a record relative to them (based on a customer ID# which is included in the subject of the email). ...
1
vote
1answer
64 views

How can I forward email service email to a different address?

I will be having email alerts sent to clients and I want their replies to go to an Email Service address. But I can't simply make that long address the "From" address because that must be an org-wide ...
0
votes
0answers
35 views

Apex Email: Html template

I am using the following code to send an email to user using HTML template. This issue which i am facing is i am getting email but the body of the email is blank. Am I doing any mistake in the code. ...
1
vote
0answers
38 views

How can I convert my htmlBody to plainTextBody using Apex/Regex

The emails that are being recieved by my apex-email-service do not have plainTextBodies. Is there a way to convert HTML to PlaintextBody in apex?
1
vote
2answers
58 views

ToAddress getting duplicated in emailing class

I have below emailing class where I am getting mails with my mail ID two times in To of the email generated. How can I make it place once in To section of the mail? Code: Public Set<String> ...
1
vote
1answer
46 views

Singleemail class Font Size change to 11

I have below statement to trigger mails from apex class. But here though I put size as 11, It sends mail with size 8.5. Can someone let me know , how to achieve desired output? code: ...
0
votes
0answers
27 views

Email service Forwarding Kink

Why is there a difference in my email's plainTextBody when I manually forward an email to Salesforce versus auto-forwarding? Shouldn't the plainTextBody of the email always be the same? When I ...
2
votes
4answers
144 views

Put Paragraph tag for email send body

I am getting error while putting paragraph tag for emailbody as below. Can someone suggest the wayout here? mail.setHtmlBody(<p style="font-family:Calibri"> body</p>); Error: ...
0
votes
1answer
49 views

Parsing Plain-text during Email Service

I have being trying to Parse this text properly for a couple days now. I cannot seem to figure out how to collect the text after Traveller name in the following Text: ---------- Forwarded ...
0
votes
1answer
35 views

Change font in singleemail messaging

I have below emailing code where I need to send mail in Callibri font. Can someone let me know a wayout here? Code: Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); ...
1
vote
1answer
91 views

Parsing plain-text body in Email service class

I am trying to parse an Email body for text that follows "name: " within a plain-text email. Should this not do the trick? The field is not being populated Pattern p = ...
0
votes
1answer
66 views

email notification that is sent to the Opportunity Owner if the opp is ‘Past Due’

Email alert to send an email everyday once to the opportunity owner if the opportunity is Past due. I guess workflow could not be useful in this case... as far as I know scheduled batch class has to ...
0
votes
1answer
208 views

Email Body Text capture in Email Service

Within an email-service apex class, I am trying to scan the body of an incoming email for the following text: Name: James Johnson Email Address: jamesjohnson@gmail.com How would I use my apex class ...
0
votes
1answer
58 views

Call schedulable batch class from trigger instead of any schedule

I have below schedulable batch class. I need to call this from an apex trigger on Compliance_Incidents_abv__c. Can someone let me know how can I do that? Batch Class: global class ...
0
votes
2answers
87 views

Email Service Verification?

Will I need to verify my email in order to activate my email service? I can't imagine that Gmail would allow an external domain to collect emails without permission...Yet salesforce hasn't sent me ...
1
vote
1answer
182 views

Method does not exist or incorrect signature: [Messaging.SingleEmailMessage].setToAddresses(Set<String>) DM Mail

I have below mailing method where I am getting subject header as error. Code: Map<Id,String> ManagerMap= new Map<Id,String>(); Map<Id,String> RepMap= new ...
0
votes
2answers
75 views

List has no rows for assignment to SObject: Publish

I have below line where I am getting Error as mentioned in subject header. Can some let me know the reason? Ideally it should return Email value. String Emailing1 = [SELECT Email ...
1
vote
1answer
26 views

InboundEnvelope gives mangled from email address

I wrote a Salesforce email handler class in which I need to store the From address and later send emails to it. But I noticed that the from addresses were mangled for emails coming from my company. ...
4
votes
0answers
49 views

how to hide salesforce email address?

I have a requirement where... my company works for different clients(like Orange, Apple, Avacado,etc.) and it's customers. We send requests and quotes to different customers on behalf of different ...
1
vote
0answers
41 views

Embedding an image in PDF attachment using html tags and Blob.toPdf()

I want to add an image to a pdf I am creating and attach it to an email that I send via apex code. I am using html and Blob.toPdf() to make the pdf. I saw this post regarding Blob.toPdf()'s ...
1
vote
1answer
53 views

Inbound Email handler and to get only latest mail

I am writing an Inbound Email Apex Handler. My situation is that whenever we get a reply from a client through email to salesforce, I only want to parse through the mail that was sent now and not ...
1
vote
0answers
34 views

Regex works fine in regex101.com but get failed in salesforce api

Can anyone suggest what is not compatible with salesforce in below REGULAR EXPRESSION: (?s)^\s*Contact received.*(?-s)(?<=Phone Number:)\s*(.*) TEST STRING: Contact received E-mail Address: ...
0
votes
1answer
62 views

Email from trigger doesnt deliver from sandbox

I have written a custom trigger , which sends an email to a contact , "after update, after create". Using System debug messages I have ensured that the code is working as expected. but the issue is: ...