nroeder
#1
how can i make cc conditional based upon email1.value being blank?
{
"message": {
"subject": "{{textInputSubject.value}}",
"body": {
"contentType": "Html",
"content": "{{richTextEditorBody.value}}"
},
"toRecipients": [
{
"emailAddress": {
"address": "{{emailTo.value}}"
}
}
],,"ccRecipients": [
{
"emailAddress": {
"address": {{email1.value}}
}
}
]
},
"saveToSentItems": "true"
}
Tess
#2
Hi @nroeder Would something like this work for your use case?
...(someCondition && {b: 5})

nroeder
#3
That seems like it would work but I get an error.
{
"message": {
"subject": "{{Subject.value}}",
"body": {
"contentType": "Html",
"content": "{{Body.value}}"
},
"toRecipients": [
{
"emailAddress": {
"address": "{{EmailTo.value}}"
}
}
],
...({{emailCC.value}} && {"ccRecipients": [
{
"emailAddress": {
"address": "{{EmailCC.value}}"
}
}
]})
},
"saveToSentItems": "true"
}
"message": "Unable to read JSON request payload. Please ensure Content-Type header is set and payload is of valid JSON format.",
Tess
#4
Hi @nroeder
Thanks! I'd recommend copy/pasting the body code into a transformer (for testing purposes only) to see if it shows a more specific error.
Also, can we see the full query?
Do you know if the contentType is supposed to be "Html"? I'm wondering if it's expecting text/html
?