Skip to Content
0

How to send email from C4C without Outlook Integration? EmailActivity is depricated; Activity BO?

Feb 23, 2017 at 06:15 AM

440

avatar image

Hi All,

I am trying to trigger a mail on click of a button in C4C.

I tried using EmailActivity BO for the same but the same is depricated. Can we use Activity BO to send mail? Activity has similar fields but the issue is assigning the values to the fields like MailTo, MailFrom etc.. these fields are locked as Read only and more over I need to send the mail from the button which is in a custom BO and not Activity BO. Is there a way to get this done?

Thanks,

Srihari.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Santosh Kumar Vadicherla Feb 23, 2017 at 07:28 AM
0

Hello srihari,

  • Go to Business Config > Open Activity List > Fine Tune > Email and Fax Settings
  • Select Email and Fax Settings
  • Add the allowed Sender Email Domain for e.g. company.com
  • Add the allowed Sender Email Sub Domain for e.g. contact@company.com
  • Add the default sender address for e.g. donotreply@company.com

Hope this config steps will helps you.

Thanks

Happy

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Happy,

This is already configured in my Tenant.

Even then the mail is not getting triggered.

Thanks,

Srihari.

0
Suchita Phulkar Feb 23, 2017 at 11:48 PM
0

Hello Srihari,

Check the following blogs that may help:

how-to-send-an-email-with-attachments-in-sap-cloud-application-studio

c4c-email-with-attachment.html

tutorial-sending-emails-from-byd

Let us know how it goes.

Regards

Suchita

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi Suchita,

Based on the blogs i have done the below coding, I have debugged the code and debug goes fine, but there is no mail.

Please suggest

import ABSL;
import AP.PC.ActivityManagement.Global;
import AP.Common.GDT as GlobalDataTypes;

//Email vars
var elActivityRoot : elementsof Activity; 
var instActivity; 
var elActivityParty: elementsof Activity.Party;
		//Type of Activity(Email = 39)
        elActivityRoot.TypeCode = "39";
		//Subject
        elActivityRoot.SubjectName = "OAM Registration"; 
		//Create new instance
		instActivity = Activity.Create(elActivityRoot);
		//Set Email From
		elActivityParty.PartyName = "5000000009";
		instActivity.MessageFromParty.Create(elActivityParty); 
		//Set Email To
		elActivityParty.PartyName = "5000000009";
		instActivity.MessageToParty.Create(elActivityParty);
		//Set Email Person Responsible
		elActivityParty.PartyName = "5000000009";
		instActivity.EmployeeResponsibleParty.Create(elActivityParty);
		
		//Send Email
		instActivity.SendMail();

Thanks,
0

Hello Srihari,

For me the code below works.

Bye,
. Horst

import ABSL;
import AP.Common.GDT;
import AP.PlatinumEngineering as Platinum;
import DocumentServices.Global;

// receipients
var Receipients	        : EmailRecepientDataTable;
var EmailReceipient	: EmailRecepientData;
EmailReceipient.EmailRecepientTypeCode = "TO";
EmailReceipient.EmailUri.content = "foo@bar.com"; 
Receipients.EmailData.Add(EmailReceipient);

// subject
var Subject : XPEString;
Subject = "Test E-Mail";

// body
var Body : XPEStringTab;
var Line : XPEString;
Line = "Hello - Goodbye";
Body.XPEString.Add( Line );

// send e-mail
Mail.Send( Subject, Body, From, Receipients);
1

Hi Horst,

I declared the var From type Email URI and passed nothing to it.

It has triggered a mail. IT worked for me.

But yet to understand how this will automatically default donotreply@nnnnnn.crm.ondemand.com.

Thanks,

Srihari.

0