Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [apex-email-service]

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

-1
votes
0answers
18 views

Append case id in subject on reply to email

I am working on email to case. My requirement is: Whenever a user send email from outside to salesforce generated email service address, case record should be created. After that user should receive ...
1
vote
1answer
27 views

Email to Case (Using thread Id)

I am working on email to case. My requirement is whenever a user is sending mail from outside to salesforce generated email address, case should be created and reply back to user with case id in ...
0
votes
1answer
7 views

Record not creating from non existent contact - email to custom object

I have an email to custom object record creation working for contacts that exist in the system. However, if a contact doesn't exist I can't seem to figure out how to get the record to create with the ...
0
votes
0answers
23 views

How to capture reply in email service

I am working on email to case. Whenever i am sending mail to salesforce from outside, case record is created and in reply i am getting case id to that email from which i have sent email to saleforce. ...
0
votes
1answer
42 views

Receive reply in Email Service

I am new to Email Service concepts in salesforce. Please help me out. I am working in Email to Case. When someone send email from outside to salesforce then new case record should be created which ...
0
votes
0answers
33 views

Apex inbound email handler is not working when email is sent to Salesforce from Surface device

We have a requirement in which if a User sends an email to a particular email address( say Client@Email.com) then new custom object record needs to be created. To implement this, we created an Email ...
3
votes
1answer
113 views

Regex implementation in Salesforce: getting from known string to end of the line

I have an email service that parses an email and inserts or updates a set of fields. I have trawled through previous questions and can see that many regex posts are voted down for being not '...
0
votes
0answers
17 views

Save Email Conversion

I'm trying to use the Lightning Experience UI to send an Email from a Record Homepage via the Activity tab. That way the email that sends from this UI is saving (in a not surprisingly way) in the ...
0
votes
1answer
33 views

“Reply All” , “Reply” and “Forward” buttons not visible in the Send Email Activity on an Apex generated email

I have an Email Service with an Apex class that creates a new EmailMessage object associating the sender with a Contact in the system and the recipient as a User. The email shows up correctly with all ...
0
votes
0answers
23 views

Is it possible to schedule sending a VF Page via Email?

We have this requirement that says we need to schedule once a month the sending of a VF page that contains custom dashboard charts via email. So if we break this requirement down, we need to do the ...
-1
votes
1answer
25 views

Image dynamically added to all Salesforce apex emails

Any time I send an email from Apex using the messaging class, Salesforce is automatically adding an image to the bottom of the email. The image appears as a box with a red x in outlook. This looks bad ...
0
votes
1answer
21 views

how to compare emails with trigger in two objects

Good morning, I'm new to the apex trigger world and I have a problem. I need to create a trigger that compares me to the emails of leads and if it coincides with an email of "Candidato_wifi". Do not ...
0
votes
1answer
25 views

Finding correct 'To Address' on inbound emails

I have built an apex class (below) that creates a custom object 'Messages' each time an email is sent in via the email service. All works well except unfortunately the to address being saved is the ...
0
votes
1answer
21 views

Apex code mail is not sending

i have tried out with the following code - am getting an exception of daily allowance of mail send,but actually none of the mails are send.whats the issue in this code?? public static void ...
0
votes
1answer
32 views

System.StringException: Invalid id: a5bK0000000HSWA

I am trying to get the id of the record from email subject. This is the subject of my email and ID a5bK0000000HSWA Subject: ABSI for approval. ref: a5bK0000000HSWA Now I am getting the id using ...
3
votes
0answers
104 views

Email doesn't get sent even after changing the email address for error: The target object email address is currently marked as bounced

I am running into an issue when I want to send an email via apex. The problem happens occasionally only with some emails from some domains. The error in specific reports: Messaging.SendEmailError[...
0
votes
1answer
80 views

Testing Error System seems to not recognize test class

ERROR: Unable to run tests synchronously: [This class name's value is invalid: Opportunity_EmailServiceTest. Provide the name of an Apex class that has test methods.]. @isTest private class ...
1
vote
1answer
30 views

Scratch Org Capabilities with regard to EmailServiceFunction

When I create an EmailServiceFunction in the scratch org and pull down to my local project I don't see the EmailServiceFunction I created reflected anywhere in the meta-data. Is this a change that can ...
-1
votes
1answer
40 views

Unable to create cases through Apex InboundEmailhanlder

I'm trying to create cases through incoming email by using Apex Inbound Emailhandler. It worked very well for a sample class which pulls the contact id based on incoming email address and creates case....
0
votes
1answer
28 views

Remove Reply-To email address

I am working with the approval process. When the workflow send the email alert to the user. The mail contains the reply-to email adrress which is wrong. I want to remove that option OR set it to the ...
0
votes
1answer
40 views

How to set singleemailmessage with brandtemplate

I am trying to send out an email from apex by utilizing emailTemplates. I am also changing text dynamically in Apex, and passing that into the emailTemplate. I do receive the email correctly with all ...
0
votes
1answer
67 views

How to display letterhead Email Template using Apex

I am able to send an email from VF page, and am getting the emails with the proper text formatting, but I am not getting the letterhead associated to the email template that I am referencing. Is that ...
-1
votes
1answer
79 views

Parse email body using strings to create case and populate it's fields

Need a help with email services. I'm trying to create cases through emails by using InboundEmailHandler. Our customers have a predefined email format (please check the screenshot). Once the email is ...
1
vote
0answers
20 views

Capture Approval Email reply with Apex

In an Approval Process, with email approval activated, when an approver replied by email, is it possible to capture that email and do additional processing with Apex? What I want is to forward the ...
2
votes
1answer
82 views

How to process image URLs in Email Services?

I have written an inbound email service to created records based on custom object. This email service processes replies to the outbound email sent from Salesforce. The outbound email's template and ...
2
votes
1answer
85 views

What happens to Email Addresses in Email Service of Full Sandbox after sandbox is refreshed from production and how to retain them

We have 2 Email Services each having separate Email Addresses created in Full Copy Sandbox. As Email Addresses are to be manually created(and not deployable) we created Email Addresses for these 2 ...
2
votes
1answer
97 views

What does Messaging.InboundEmail.htmlBodyIsTruncated really mean?

The apex class Messaging.InboundEmail represents an email received by an Apex Email Service, which is handed to an implementation of the Messaging.InboundEmailHandler interface (provided by the ...
0
votes
1answer
18 views

trigger on email sent to third party email id from salesforce

Wanted to track emails sent from salesforce to any third party email ids and not the contacts or any internal user.
2
votes
0answers
70 views

Apex SendMail() method emails received when executed as anonymous but not from code

We have been struggling with this for a day now and the answers on the web have not been helpful, so I'll be explicit in describing our issue. We have implemented a wrapper method for SendMail() as ...
0
votes
1answer
83 views

Operation 'EmailToApexHandler' is not appearing in debug logs while verifying Email Service

Earlier, I have successfully performed the steps outlined in the answer of how-to-leverage-org-wide-email-address-within-an-email-service to verify the Email Service Address generated by Salesforce. ...
0
votes
0answers
58 views

sending a mail in apex with the mail appearing in the case chatter feed

Using our current configuration, if I send an email manually from the email section on my case, the email is tracked in my case feed. Now i want the same thing to happen, when i send the mail via ...
14
votes
1answer
369 views

How to use an Apex Email Service to store emails on a record EXACTLY as Salesforce does?

I have used the Lightning Experience UI to send an Email from a Record Homepage via Activity-Tab. This looks like this (bottom-right!): Now I want (vice versa) to store an incoming email received by ...
0
votes
2answers
40 views

How to prevent emails from failing when a bounce-back occurs

If an email is sent out by Salesforce to a dead email address in a batch of email addresses, the process should continue for remaining email addresses instead of terminating the process upon failure/...
0
votes
0answers
65 views

Cannot query on IsPrivateDraft field of EmailMessage

I have a field named IsPrivateDraft in EmailMessage, I want to use that field for updating the draft EmailMessage. I want to know the value of this field but cannot use it in query. On using the field ...
2
votes
1answer
197 views

How to leverage org-wide email address within an email service?

I'm leveraging 'Send an Email' button for a custom object(comm__c) which has a lookup to the case object. While sending the email the user sets the 'From email address' to a specific Organization-Wide ...
0
votes
1answer
22 views

How can I report on Salesforce's 'External Email limit' for my specific organization?

I was looking at the Governor Limits page: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm And I wanted to see if we can see how close our org comes to ...
1
vote
2answers
91 views

Inbound Email handler - Status being set as 'Sent' instead of 'New'

I have the following Email handler Class: global class InsertReplyEmail implements Messaging.InboundEmailHandler { global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email,...
0
votes
0answers
73 views

Remove on behalf of from emails

I am triggering emails from a piece of Apex Code. What is happening is that, it is showing me noreply@salesforce.com [mailto:noreply@salesforce.com] On Behalf Of Test User<test.user@domain.com> ...
0
votes
0answers
11 views

Email integration communities

Communities does not support salesforce for outlook and salesforce for Gmail I have a Scenario where a record(opportunity) along emailmessage record should get created when a customer send a email to ...
0
votes
0answers
121 views

Send automated notification after Bulk Data Load job is completed. Is that possible? ( like automation)

I’m trying to set up an automated monitoring on bulk data loads. We regularly load data into Salesforce using default Informatica powercenter ( another database). Results can be inspected in the ...
0
votes
1answer
177 views

Single Email Limit Exceeded Error [duplicate]

while am executing this code am getting this error as single email limit exceeded. An Apex error occurred: System.EmailException: SendEmail failed. First exception on row 0; first error: ...
0
votes
1answer
117 views

Create a Salesforce file from an email attachment

I am using the custom email service to receive an email with an attachment. I can create a custom object record and associate the email attachments with it. Since the direction is to move away from ...
0
votes
0answers
31 views

Need help parsing email body

I have an email service where clients can send me yes/no answers to questions I ask yet a lot of responses include narratives such as, "No, I do not like green eggs and ham," (and others). Rather ...
0
votes
0answers
58 views

Visualforce email template pdf- attach into the record

i have an visualforce email template it will render as pdf and send an email.now i want that pdf to be inserted to the related record.how to achieve this.Below is my visualforce email template code &...
1
vote
1answer
240 views

Outlook calendar meeting Invite in APEX

I am sending a meeting invite to outlook, using icalendar for this. I am able to send the invite and it sits as attachment in the email but not as a direct meeting invite. User needs to open it up and ...
1
vote
1answer
36 views

Fetching bccAddress from Messaging.inboundEmail

We are using Email Service and its handler class creates custom record in Salesforce based on its content. Please let me know if there is any possibility to capture the bcc address from Messaging....
1
vote
1answer
150 views

How do I handle bounced emails with email field in custom object?

I am using a custom object to track students (outside of Contact and Leads) and also has an Email field we use as one of the contact methods. How do I flag undeliverable messages so I can mark them ...
1
vote
1answer
57 views

Unable to open Inbound Emails created via Email Service Class

I have written an Email Service which goes like this : global class myHandler implements Messaging.InboundEmailHandler { global Messaging.InboundEmailResult handleInboundEmail(Messaging....
1
vote
1answer
534 views

Issue Setting ContentVersion Owner

I am getting an attachment via a Salesforce email service and in the Email service apex class logic, I query the user object by the email from address and set the ContentVersion owner as the user ...
0
votes
1answer
21 views

What is Pattern idPattern in inbound email service?

Can anyone explain what is Pattern idPattern and Matcher in the flowing class? I've seen in many classes with different patterns like Pattern idPattern = Pattern.compile('006[A-Za-z0-9]{12}'); and ...