Post

3 followers Follow
0
Avatar

REST API SendEmail

https://success.clarizen.com/hc/requests/37758

https://api.clarizen.com/V2.0/services/utils/SendEMail

def send_email(self):

data = {'subject': 'email subject',
'body': 'email body',
'recipients':
[
{
'recipientType':
{
'To': 'joe.teumer@mbx.com'
},
'user': 'User/6e8647a3-d3fd-4dcc-8395-7bb1b099b1bb',

'eMail': 'joe.teumer@mbx.com'
},
],
'relatedEntity': '/Task/2x0z25skb7fvbsa7752bj0r8w2911'
}
response = requests.post(_ApiUrls.Base + _ApiUrls.SendEmail, data=json.dumps(data), headers=self.headers)
result = self._get_api_result(response)
return result

Exception: 500
Error Code : InvalidOperation
Message : Invalid operation: Could not convert to RecipientType
Reference ID : 2DsFajyn9SeLDeQZbBPftc

Joe Teumer Answered

Official comment

Avatar

Hi Joe,

The RecipientType value should be just "To" or "CC". You've added the email address to the value.

 

I hope this helps,

Elad

Elad Franklin
Comment actions Permalink

Please sign in to leave a comment.

3 comments

0
Avatar

{
"subject" :"Hello Testing Api",
"body" : "Test Mail",
"recipients" : [{"recipientType" : "To",
"user":"/User/f16f63c9-3bb1-4b90-859e-ef1f831d1557",
"eMail":"abc@gmail.com"}],
"relatedEntity" :"/Task/hvrjwovmemdz3iba54fk2ptf386"

}

 

I tried above body but mail is not coming in my mail box. Its showing 200 response code .Please assist.

Kansalmukul 0 votes
Comment actions Permalink