Questions tagged [apex-email-service]
Email services are automated processes that use Apex classes to process the contents, headers, and attachments of inbound email.
145
questions with no upvoted or accepted answers
4
votes
2
answers
239
views
Duplicate Lead creation from EmailService
I have an EmailService that takes the data from an email and creates a Lead if no match is found for the supplied email address. If a Lead is found then the Lead is updated with the new details ...
4
votes
0
answers
5k
views
Email To Case - Duplicate Cases
Have an interesting problem with Email To Case setup, scenario is User A sends an email to a support mailer and copys User B on it. Auto response would go to User A. If User B picks up the first email ...
3
votes
0
answers
959
views
Mocking Inbound Email Headers in Test Class (In-Reply-To or References)
We have a custom email handler in apex. With the new changes upcoming to remove Thread IDs (https://help.salesforce.com/articleView?id=000355168&language=en_US&mode=1&type=1), we are ...
3
votes
0
answers
761
views
The target object email address is currently marked as bounced
I have activated bounce management in two dev orgs. I am sending emails to record owner through batch class. If email is not valid, DEV1 org is throwing a message Email address is invalid and DEV2 org ...
3
votes
0
answers
513
views
How do I associate a reply email to a Lead with an Inbound Email Handler?
I am attempting to create an inbound email service that will add attachments to a Lead. The basic flow is:
send an email with Apex to the Lead -> Lead replies to the email -> Inbound email ...
3
votes
0
answers
673
views
Email Services + How to handle undelivered or bounce emails
This might be a known issue. But i could not find enough info to resolve the issue. We are using Email Service's email address as a From address to send emails to consumers. If consumer's email ...
3
votes
0
answers
3k
views
Setup Auto-Response Rule when using Email-to-case for emails not related to an existing case
We have a specific workflow where most messages send to support and our other address is specifically given to the client once they have signed up and we email them directly. I am trying to setup an ...
2
votes
0
answers
54
views
Customize the standard outbound email from Salesforce
We have enabled EnhancedEmail in our org and our users are able to email the customers directly from Contact record as shown below
Since this sending of email from Salesforce to a contact is a ...
2
votes
0
answers
639
views
Cannot access sObjectType 'OrgWideEmailAddress'
I am encountering an exceptionally unusual issue.
I have a User A (running under Profile A). This profile has minimal permissions. It has only Permission Set A
Permission Set A gives "View Setup ...
2
votes
1
answer
3k
views
Messaging.renderStoredEmailTemplate() is rendering Visualforce email template without custom header
Messaging.renderStoredEmailTemplate() is rendering Visualforce email template without custom header.
I have a requirement to send an email with custom header. So created a visualforce email template ...
2
votes
0
answers
1k
views
Make Lightning buttons Reply/Reply All/Forward visible for everyone
As per documentation Reply/Reply All/Forward buttons on EmailMessage are visible only for users who are mentioned in To/CC/BCC.
In our case we need whole support department to be able to reply any ...
2
votes
0
answers
640
views
How to make Reply, Reply All, Forward options available
I have created a new email service which populates a Lead__c field on the emailMessage object. Then i am displaying the emailMessages in a related list component. However, even though im getting the ...
2
votes
0
answers
285
views
which is best approach for custom email alerts, Declarative vs Programmatic?
Object_A and Object_B are two related(Lookup) objects in Salesforce, where A is parent and B is child. Requirement is, when a new Object_B record is created, an email alert should be sent to Object_B ...
2
votes
0
answers
166
views
Does an Email Service accept Emails sent by phpmailer?
I have issues setting up an Email Service which should receive Email sent by an web-form using phpmailer.
Now I've configured it like this:
I've set no restriction to "Accept Email From" in order to ...
2
votes
1
answer
758
views
Email Services Apex Class - Remove images and replace with text instructing user to check attachments section
I have put together an Apex class for a Salesforce Email Service. This is taking the email that is sent to the address, taking the subject and email body and creating a record for a custom object I ...
2
votes
0
answers
4k
views
Dynamic Email Template Body
I have a requirement where I need to send the email template and also allow the use to change it and then send the content.
I am able to send email and attach a VF template dynamically. But I am not ...
1
vote
0
answers
70
views
Error implementing EmailServicesFunction metadata
I am trying to implement EmailServicesFunction metadatservice but getting error when I execute it in anonymous window.
Error occured processing component NotificationReplyService. An Apex Class must ...
1
vote
0
answers
1k
views
Email to Case using Apex: Right contact not populating in email message
I am using custom email to case Apex class to create case records. After the case is created I am changing the contact name to some other person. When I goto the email composer salesforce is picking ...
1
vote
1
answer
2k
views
Sending Lightning Email Template from Apex code
I'm trying to send an Lightning Email Template via APEX, have not been able to do so.
I get no exception or anything, just no email gets sends. With various System.debug() commands I'm able to ...
1
vote
0
answers
737
views
Deploying EmailServicesFunction metadata file
I have created an Email Service Function which looks something like below:
<?xml version="1.0" encoding="UTF-8"?>
<EmailServicesFunction xmlns="http://soap.sforce.com/...
1
vote
0
answers
1k
views
An email can't have more than 1 sender error
I have an email service.
When sending an email to the email address that SF provided :
sffdc@skuh7gi7z4fo72pt6h2o.1l-8dix.....apex.sandbox.salesforce.com
I need to check the "from address" and ...
1
vote
0
answers
154
views
How can I send an email while using PageReference getContent() method?
I am trying to send an email while using PageReference and the getContent() method which is, only ocassionally, throwing an error (seems like every couple of emails regardless of the frequency). ...
1
vote
0
answers
2k
views
Sending LWC Email Template
We have a report that we currently generate using Conga (3rd party license), in the past we've made similar visual representations of the data using VisualForce, but now as we consider the ...
1
vote
1
answer
357
views
Email Service creating multiple Cases when sending to multiple aliases in a single email
Our org is currently using a custom Email Service to create cases and we have multiple Email Service aliases.
Currently, when a customer sends an email to multiple Email Service aliases, our service ...
1
vote
0
answers
145
views
Associate Task to attachment in inbound email service
Hello I have created a Email service to capture customer replies. It is working fine. But I am not able to associate Incoming Email attachments with task. I can associate`` them with contacts but not ...
1
vote
0
answers
417
views
How to capture customer replies in Salesforce
We want to log outbound and inbound emails in Salesforce. Currently, We are sending Emails to Contacts using out of the box salesforce features and they re getting logged But when contacts reply to ...
1
vote
0
answers
134
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 ...
1
vote
0
answers
509
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 ...
1
vote
1
answer
330
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
0
answers
2k
views
Email Template not working
I'm trying to send an Email with an attachment and a template.
EmailTemplate emailTemplate = [Select Id from EmailTemplate where Name = 'Test Mail'];
List<Messaging.SingleEmailMessage> allmsg =...
1
vote
0
answers
81
views
Programmatically generate Inbound Email Service address
I have an Apex class implementing Messaging.InboundEmailHandler.
Due to external constraints I have to use a new Email address for every Customer. If I am an administrator, I can define a new address ...
1
vote
0
answers
129
views
Reading ICS file via Salesforce Email Handler
we have a request to read ICS file and generate activity in salesforce. I was able to from Google Calendar, Mac Outlook client via reading text attachment of ics file. But when with Windows Outlook ...
1
vote
0
answers
755
views
Updating the Parent ID of Email Message. Working in Classic but not in lightning
Hi we have created a custom code for updating parent id of EmailMessage it is working in the classic but has error when we switch to lightning. Error we receive is
Operation is not allowed
Trigger:...
1
vote
0
answers
503
views
Email Service implementation - Inline Images appear as 'Inline Image 1'
I have an Email Service set up to implement the Messaging.InboundEmailHandler interface.
For Cases created through my Email Service, the images in the sent email appears as 'inline image 1' and ...
1
vote
1
answer
24
views
Is there any way to embed buttons in Web to Lead Email?
I have a requirement wherein, I should be able to embed a button in salesforce email which I get when I(user) create a lead from Web to Lead form.
I should get an email with a button in it which ...
1
vote
0
answers
445
views
System.EmailTemplateRenderException: Too many SOQL queries: 101 Exception
Facing 'System.EmailTemplateRenderException: Too many SOQL queries: 101' exception while using visual-force email template with custom controllers.
Api - Messaging.SingleEmailMessage templateInstance ...
1
vote
0
answers
173
views
EmailAuthor - Add attachments on record
I've created a custom "send an email" button with a URL hack as follow:
/_ui/core/email/author/EmailAuthor?p3_lkid={!RMA__c.Id}&retURL={!RMA__c.Link}&p2_lkid={!RMA__c.ContactID__c}&...
1
vote
0
answers
684
views
How can I see and delete Email Messages Records in the org?
I was looking at our Data usage in the org and realized that 7% of our data storage is taken up by Email Message Records. This document says EmailMessage represents Email Messages in the org. How can ...
1
vote
0
answers
229
views
setFileAttachments method on MassEmailMessage class available?
According to the docs, MassEmailMessage class does not have the .setFileAttachments method.
The reason why I'm using MassEmailMessage in the first place is because I cannot use the .setToAddresses ...
1
vote
0
answers
103
views
What happens to emails being sent to orgwide address 'Return-Path' value
Some of our customers are replying to the 'Return-Path' value of emails being sent out by us (most likely through their email client or server settings, see my question here)
I'd like to know what ...
1
vote
0
answers
35
views
Can we send the follow up emails on the already send system email?
I have a requirement, as per which the system sends an email notification in each quarter to the Account contact for some document submission. Now, the system has to send a follow email after every 7 ...
1
vote
0
answers
24
views
Options for a Simple Inbound Notification Methods to Trigger some processes
I have a dataloader process that pushes data into several different orgs. The process starts once a complex extract process has completed and created a set of files.
I'd like to change the process ...
1
vote
0
answers
534
views
Split a PDF apex page into separate PDF pages based on pagenumber
I have an Apex PDF page which I need to email to logged in User. Now when Page number exceeds 10 , I need to send in a separate PDF. Like if I have 15 Pages, PDF1 will have 10 pages , PDF2 will have 5 ...
1
vote
0
answers
53
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 [email protected] for contact1 amd [email protected] for contact2. When I send Email Message to [email protected], I'm getting the email immediately. Whereas the ...
1
vote
0
answers
129
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: ...
1
vote
0
answers
171
views
Remove the reference code from customer emails?
Salesforce includes a very strange and long reference code in the subject of customer emails, which I don't think is necessary, because it's also included in the body of the email, and just ends up ...
1
vote
0
answers
2k
views
How to set multiple "setwhatIds" and "setTargetObjectIds" in salesforce?
How can I set multiple objects Id in targetObjectsIds and WhatIds?? Whenver I tried to do that it gives an error
String[] bccAddress = new String[] {'[email protected]'};
Messaging....
1
vote
1
answer
2k
views
can setTemplateId be used along with SetHtmlBody for the following code?
public EmailMessageWrapper(String fromAddr, Id toAddrId, String sub, Map<String, String> mapSubjectParams, Map<String, String> mapBodyParams) {
this(fromAddr, null, toAddrId, null, ...
1
vote
0
answers
39
views
Customer Attention email
The email that is sent to a portal user when their case is updated (to Customer Attention) comes from the an employee that updated the case. Can we have it come from [email protected] instead?
...
1
vote
0
answers
284
views
SingleEmailMessage CC is not working
I'm trying to send emails with TO, CC and BCC addresse
mail.setTemplateId(emailTemplateId);
mail.setTargetObjectId(emailTargetId);
mail.setSenderDisplayName(Label.Sender_Name);
mail.setReplyTo(...