6

Yes you can, but you have to first ask support to turn it on: Contact your account representative to have this feature enabled for your account. You must be familiar with AMPscript to send emails with attachments. Here is the whole description: https://help.salesforce.com/articleView?id=mc_es_email_attachments.htm&type=5 You will need to use ...


5

Short Answer: No its not posssible to read Excel in Apex. Long Answer: Excel files(xls,xlsx etc) are not a text based file. They are binary files. Thus unlike CSV(text based) they cant be read line by line/character by character. You would need a third party integration to convert your excel to CSV. Meanwhile, there is an idea on Ideaxchange to provide ...


5

Salesforce files have superseded attachments. A single attachment can have only one parent and access to attachments is controlled by the parent record. If we want to attach same file on two different records then we would need to upload that attachment to a new record thus consume extra storage and having redundant files. The same two limitations are ...


4

Excel is warning you that the internal structure of the file is not a real Excel Workbook format. The software is intelligent enough to recognize that it is something else (I presume you're rendering HTML/XML) and knows how to display/modify the contents, but the file itself is not an XLS file, which has specific headers and a binary format. It doesn't ...


3

The trick is to insert a ContentVersion first and then use the Messaging.SingleEmailMessage.setEntityAttachments method with the ContentVersion Id. The attachment goes out with the email and is stored in Salesforce. Sample below attaches a PDF. It is not bulkified, but you get the idea: ContentVersion cv = new ContentVersion(); cv.VersionData = <...


2

you are trying to set the properties 'fileName' and 'body' to a List of EmailFileAttachment. You shoud instead create a single EmailFileAttachment variable and add it later to the List: List<Messaging.EmailFileAttachment> efa = new List<Messaging.EmailFileAttachment>(); Messaging.EmailFileAttachment singleEfa = new Messaging....


2

Your collection type is List<Messaging.EmailFileAttachment>. That means each element within the collection (for example when you call add()) must be of the type Messaging.EmailFileAttachment. But instead, you are trying to add an element whose type is Attachment. Instead, you should start with: Messaging.EmailFileAttachment eAttach = new Messaging....


2

The only solution I could figure at all is to sadly forget about the incomplete EmailMessage Salesforce has been created for us and start over from scratch by inserting a brand new EmailMessage having proper attachments. This is very sad, because it's not even easy to delete the incomplete one with out a trigger and some kind of flagging it. So I just ...


2

You can use toString() of Blob class. Example: String myString = 'StringToBlob'; Blob myBlob = Blob.valueof(myString); System.assertEquals('StringToBlob', myBlob.toString()); Other option is by using String.valueOf() of String class but not suggested as this returns useless string like Blob[X] where X is the number of bytes in the blob. There is one ...


2

PDF creation is not available inside SFMC, you would have to use a 3rd party platform to create those. Outside creating a complex custom script in a cloud page or script activity (high level of effort) which is likely still going to be inefficient and unreliable. Once created though, you can push them to the FTP or host them on a web server and then use the ...


2

I'd go with the answer to HTML in iCal attachment from StackOverflow. It is not strictly forbidden by the RFC, but DESCRIPTION is not the appropriate property for HTML content. DESCRIPTION should be the plain text version of your content. The property X-ALT-DESC with a FMTTYPE declaration of text/html is the appropriate property for HTML content. Combining ...


1

You will need two things: Apex Email Service and InboundEmailHandler A CSV parser. My favorite is this one by Marty Chang If the attachment is "large" in byte terms, you may run into Heap issues


1

here's an idea: after insert Trigger on EmailMessage executes a queueable, passing Set<Id> emailMessageIds Queueable won't start until after the transaction ends, by which time the attachment is associated to its parent email message. Queueable has the emailmessage.ids, can then query for the attachment(s) and do work


1

A single File (ContentDocument) can have many Versions (ContentDocumentVersion) which all link to the same record (ContentDocumentLink). Your code is pulling all the versions for the record which will include current and old versions. The easiest fix is to include isLatest to only pull the latest version of files. List<ContentVersion> versions = [...


1

So the main limitation you will find here is the amount of Heap Space required of transforming your CSV into a workable Apex Type to parse through. That said as long as the combination of Rows and Columns in your CSV doesn't exceed that limit, either approach is fine. I actually did this as an AppExchange app a while ago and used the first approach. EDIT (...


1

Solved this. The documentAttachmentMap is kind of a red herring. Although the API reference states that it "maps the relationship between an EmailTemplate and its attachment, which is stored as a Document," I couldn't see how it was actually used in this example. The relationship between a Lightning EmailTemplate and attachments is determined by a ...


1

In the email template we get Attachment list where you can attach static files. Or you can use Visualforce email template to dynamically add attachments. For that you will need code as well. This will still have its own limitation and you need to generate file at runtime. Adding Attachments If you want to send pre created attachment in email then I ...


1

In short, if an app is broken, we can't fix it, and you can't fix it. All you can do is try to contact the developer and see if they can push an update for you. This may involve checking debug logs, using login access, etc. Since the app is having its decennial birthday this year, there might not be much hope for it. You might want to start researching how ...


1

Your code is correct. The issue you are having is that pdf.getContent(); is throwing an exception and the Blob variable b is null by the time efa.setBody(b); is executed (because it was never initialised). Edit with what I mean, including the suggestion of @Rahul Sharma/Bob ;) If you put the logic outside, its easier to cover with a test, and then you just ...


Only top voted, non community-wiki answers of a minimum length are eligible