Hi there. I tried two methods for sending email in ERPNext. I had to add both the recipients and CC while sending the email. But while using frappe.sendmail() method, CC is shown as “To”.
As mentioned in the question, when I use frappe.sendmail() and include a CC, the CC is shown as “To” in the email (the email received by CC account). See this picture, it is the one received by CC account
And @rahy no i dont have much knowledge about the advantage/disadvantage of each method i just tried the make() method and it solved my prob, if you could please guide the recommended approach it will be appreciated.
Hello @Ammar-Ahmad-Khan I also had that issue myself. but I tried using the make() but it still didn’t work for me so I added
expose_recipients= ‘header’,
to the frappe.sendmail.
the code should be written like this:
frappe.sendmail(
recipients=recipients,
cc=cc,
subject=(“HAPPY BIRTHDAY”),
template=“birthday_reminder”,
expose_recipients= ‘header’,
args=dict(
reminder_text=reminder_text,
birthday_persons=birthday_persons,
message=message,
),
header=(“HAPPY BIRTHDAY!!! ”),
)