on 02-25-2015 3:56 PM
Hi Experts,
I have try send email through the Reuse Functionality as posted by Alessandro Iannacci
I can able to send email using the above new functionality but i don't know how to add existing attachment to the email and send email with multiple attachment.
Can anyone have idea or try to send email with attachment using new email functionality?
Please share your idea.
Regards,
Mithun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi SARUCHI PATHELA,
No, We have tried but not getting any success in it.
Please let me know once you achieve it.
Thanks in Advance........!!!!!!!!!!!!
Regards,
Mithun
Hi Mithun,
It works for me with the following :
import ABSL;
import AP.PlatinumEngineering as Platinum;
import DocumentServices.Global;
import AP.Common.GDT;
var Receipients :EmailRecepientDataTable;
var EmailReceipient :EmailRecepientData;
var SendFromURL :XPEString;
var EmailBodyTab :XPEStringTab;
var instance :EmailRecepientData;
var EmailSubject :XPEString;
var EmailFrom :EmailURI;
var atts:collectionof Platinum: Attachment;
var att:Platinum: Attachment;
///////////////////////////////////////////////////////////////
var ATTACHMENT_TYPE_DOCUMENT : DocumentTypeCode;
ATTACHMENT_TYPE_DOCUMENT.content = "10001";
// create PDF
var FormTemplateLanguage = "E";
var FormTemplateCode : OutputRequestFormTemplateCode;
FormTemplateCode.content = "FormTemplateHeaderCode";
var pdfDocument = OutputManagementUtilities.GetPDF(this, FormTemplateCode, FormTemplateLanguage);
if (!pdfDocument.content.IsInitial()) {
Trace.Info("document successfully created");
att.Binary=pdfDocument.content;
att.FileName="hello.pdf";
atts.Add(att);
}
///////////////////////////////////////////////////////////////
//1
EmailSubject=this.Subject;
//2
foreach(var t in this.ItemTextCollection.Text){
EmailBodyTab.XPEString.Add(t.TextContent.Text.content);
}
//3
EmailFrom.content=this.MailFrom;
foreach(var receipient in this.Recipients){
EmailReceipient.EmailRecepientTypeCode=receipient.EmailRecepientTypeCode;
EmailReceipient.EmailUri.content=receipient.EmailRecepientMailAdd;
Receipients.EmailData.Add(EmailReceipient);
}
if(!Receipients.IsInitial()){
Mail.SendWithAttachment(EmailSubject,EmailBodyTab,EmailFrom,Receipients,true,atts);
}
Best Regards,
Fred
I have checked the attachment thing is not working for me as I have created the pdf form in custom BO and I am generating the pdf in custom BO Action generate_pdf from custom Adobe form.
But I have extended the Service ticket with an action to send email where I need to send that attachment created in custom BO in an email.
Hence I need to read that attachment created in custom BO in the XBO. But the attachment created in custom BO is of type binary and the one we are using to send in email is of Platinum: Attachment;.
var ATTACHMENT_TYPE_DOCUMENT : DocumentTypeCode;
ATTACHMENT_TYPE_DOCUMENT.content = "10001";
// create PDF
var FormTemplateLanguage = "E";
var FormTemplateCode : OutputRequestFormTemplateCode;
FormTemplateCode.content = "FormTemplateHeaderCode";
var pdfDocument = OutputManagementUtilities.GetPDF(this, FormTemplateCode, FormTemplateLanguage);
if (!pdfDocument.content.IsInitial()) {
Trace.Info("document successfully created");
att.Binary=pdfDocument.content;
att.FileName="hello.pdf";
atts.Add(att); // att is of type Dependent:Engineering
So how I can read my attachment in custom BO which is of Binary and pass it to attachment in action send_email in the XBO of type Dependent Engineering.
Hi Saruchi,
My scenario is :
1. Create PDF from custom BO
2. Add a "Send Mail" button to OWL.
And it works as expected.
In your case,
1. You create one or more attachments to Attachment Folder of custom BO using its own form template
2. Send Email with one or more PDF from the Attachment Folder.
Am I right? I haven't tested but I think you can just retrieve Binary value from AttachementFolder and assign to att.Binary. Can't you?
Update :
I can send the attachments with the following:
if(this.Attachment.IsSet()){
foreach(var doc in this.Attachment.Document){
att.Binary=doc.FileContent.BinaryObject.content;
att.FileName="hello.pdf";
atts.Add(att);
}
}
Best Regards,
Fred
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.