You need to sign in to do that
Don't have an account?

Unable to send Email Notification to users when a post is created via Apex
Hi All,
I have a requirement to send emails to the account owner whenever a post is created in their feed.
I wrote the below code to insert feeditem. If i add createdbyid field in post, i am unable to get the emails.
If i comment the createdbyid, then i am able to recieve the emails.
Thank You
Arjun
I have a requirement to send emails to the account owner whenever a post is created in their feed.
I wrote the below code to insert feeditem. If i add createdbyid field in post, i am unable to get the emails.
If i comment the createdbyid, then i am able to recieve the emails.
FeedItem post = new FeedItem(); post.ParentId = '0F9c0000000DLT6CAO'; post.createdById = '005a000000BA2zjAAD'; post.Body = 'Happy Anniversary, Sean!'; insert post;Can anyone please let me know how can i achieve this?
Thank You
Arjun
createdById is used to show Who created Post. If you do not pass this Id, It will create post with the current user in salesforce.
And If Id is passed in the field it will send the email to that user who's Id is passed in it.
check with the user Email inbox.
I passed id to the createdById field. And i didn't receive any mail from chatter.
If i don't pass id, then i am receiving email from running user.
Thanks
Arjun
ANother question for you, where you're posting feed ? account feed or some where else ?
I am facing the same issue