Questions tagged [apex-email-service]

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

Filter by
Sorted by
Tagged with
23
votes
1answer
58k views

Can anybody explain the UNABLE_TO_LOCK_ROW error?

Error Message: Developer script exception from Nicomatic : quotepotential : quotepotential: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with ...
13
votes
4answers
10k views

How to test if outbound email is send

I have a batch that sends out an email notification to the triggering user when something went wrong. The code that does this is called from the finish() method. I'm now looking for an elegant way to ...
14
votes
1answer
18k views

How to get download link/url from attachment file in salesforce?

Hi I have one requirement where I am storing attachments in attachment object. After that I also want to update a custom url type field in some custom object . The value will be a direct link to ...
12
votes
2answers
20k views

How to Test Messaging.sendEmail

Looking for some help/advice in writing a test class. The class I need to test is an apex class to schedule a report that needs to be sent to an external email address once a month as a .csv ...
2
votes
2answers
3k 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 ...
6
votes
1answer
334 views

Email Service via Metadata API fails to create from Managed Package

As Email Services can't be packaged in a Managed Package, I allow subscribers to create it after the installation. The code which works in my packaging org fails in productions orgs with: An Apex ...
3
votes
2answers
254 views

How to know current Email governor limits? [duplicate]

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 ...
0
votes
1answer
649 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 ...
16
votes
2answers
2k 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 ...
7
votes
2answers
4k views

How to unzip a zipfile attachment in apex and process each file in the zip attachment

I am trying to unzip a zip file attachment. but, unable to unzip the attachment and process all the internal files in the zip file. I want to do this using an email handler class.
5
votes
1answer
6k views

INVALID_ID_FIELD, WhatId is not available for sending emails to UserIds

I am trying to run below code in trigger. List<User> recipients = [SELECT id FROM User WHERE UserRoleId=:operationsRole.Id]; for (User usr:recipients) { Messaging.SingleEmailMessage ...
4
votes
0answers
2k 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
3answers
5k views

Salesforce Email Service Debugging

I have defined an email service which unfortunately isn't working. Is there a place I can monitor errors? The class doesn't appear in debug logs.
2
votes
1answer
1k views

Email attachment not received in EmailService handler

I have an issue with processing inbound emails sent from MS Outlook. To put it simple no attachments are received in the class (nor text nor binary). Email definitely has attachments since i cc-ed the ...
2
votes
2answers
773 views

Why doesn't File Location Lookup show attachments of Opportunity?

My opportunity has some attachments. I would like to send them via email. If I hit on "Attach File" button of "Send an Email" page, then File Location lookup filter window, dialog appears, however I ...
1
vote
1answer
1k views

Inbound email missing attachment?

I have a requirement to save attachment received from email in Salesforce object using Email To Salesforce. I tried using the below code but attachment are not getting saved, when I checked using the ...
12
votes
3answers
27k views

Making regex case-insensitive

I have created some lines of code for an email handler that will scrape my emails for a particular string (STA0123). Code: // Find STA No. (in email body) Opportunity Opp = [SELECT id, STA_No__c ...
4
votes
1answer
641 views

custom Email Service - inline images appear as '[Image is no longer available]' upon Reply/ReplyAll

I recently completed a customized Email Service, to replace Email-To-Case, which handles duplicates by matching the incoming email subject with existing cases. As part of the InboundEmailHandler class,...
4
votes
1answer
165 views

'DataDotComEntitySetting' is not supported

I am writing a custom email service. I can get the incoming csv file and parse it down to rows and then columns. I do my thing, then I try to insert the objects (I know they are all original, the data ...
4
votes
2answers
2k views

getContent() returns Blob PDF-body in console, but HTML page (rendered like PDF) in Email service code

First at all: Happy New Year to you and your family. I wish you all the best in new 2014 year. And about my case: I use 'MyPdfRenderingPage.getContent();' method to get Blob PDF-body, create PDF ...
3
votes
1answer
2k views

How to get values from a Messaging.Email object

I have code which builds a list of Messaging.Email objects to be sent out based on various conditions. The problem is I want to be able to write a test which asserts that these email factory methods I'...
2
votes
3answers
5k views

Faile to send email due to SINGLE_EMAIL_LIMIT_EXCEEDED

My customer complained he got the following error message: SendEmail failed. First exception on row 0; first error: SINGLE_EMAIL_LIMIT_EXCEEDED, Failed to send email: [] Our apex code sends a single ...
2
votes
1answer
591 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 ...
2
votes
1answer
283 views

Apex: Email invocation not working in sandbox

I want to send out alert emails to account team members when their account(s) contracts are up for renewal 120 days from 'today'. I have test accounts created to meet the soql criteria, I'm in the ...
1
vote
0answers
25 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 ...
1
vote
1answer
146 views

why dynamic values are missing in emails?

I have email one email template. In that email template I'm Passing dynamic values like {!Student.Name}. But when i receive email the student name is not displaying. Here is my Html and Plain Text of ...
1
vote
1answer
121 views

Sandbox Email ( Workflow, Process Builder, Apex ) no longer send email if user email ends in .invalid

In our sandboxes Developer orgs, We have recently noticed as of May 30 2019 that emails ( workflow, process builder, apex ) have stop being sent when the invoking user's email ends in '.invalid'. ...
0
votes
1answer
80 views

Send email with attachment

I need to send email along with attachments which reside in a different platform to external email IDs. below is the code snippet which I have done so far. Please suggest how to proceed further. Rest ...
0
votes
2answers
4k views

How can I verify my Org Wide email address?

I have created an email service and apex class that converts incoming email into tasks and associates them with the matching record. the idea is to simulate email to case functionality. it works as ...