Hi
I am tring to write a JS Connector to send message to my subscription.
But I find the return value "function processDeliveryPart" is sometime strange.
I use the follow JavaScript code to return a message if the deliveryPart.message.@id is some error happed.
try{
// my code to send message
}catch(e)
msgs.appendChild(<message
id={deliveryPart.message.@id}
status="2"
noRetry="true"
log={e.toString()}
failureReason="20"
failureType="1"/>);
}
My question is :
(1) Sometime "failureReason" and "failureType" is not work. It seams that Adobe Campaign set the
"failureReason" and "failureType" 's value according to "log={e.toString()}" .
Sometime the "Reason" will be set to "Refused" even I did not set the 'failureReason="20"'
(2) would you like to explain the follow attributes to me?
status : 0: Ignored; 1: Sent; 2: Failed
failureType : 0: Undefined; 1: soft 2: hard
failureReason : 0: Undefined; 20: Refused
What I know is the up. Is it right? Where can I find the guide about these attribute?
(3) Some time a deliveryPart.message.@address will be "Quarantine" under
"Administration -> Campaign Management -> Non deliverable Management -> Non deliverables and addresses",
what is the reason?
Best regards.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi tumuzhuanjia,
I don't know if the classic quarantine management for emails and SMS is valuable for the WeChat service, I don't know WeChat at all, but it should work as Facebook and Line channels more or less?
Anyway, please find the usual documentation in TechNotes here:
and also enumeration values and other explanations here:
Delivery and tracking
(I used these documentation past years, I don't know if it are useful for other channels).
One more thing, in your screenshot the line highlighted is "hard" type. Perhaps the WeChat service works as for MX or SMS platforms, by delivering feedback later and so putting it in hard bounce the quarantine record, after X soft bounces trial to resend (as for mails management ?).
How is defined the delivery WeChat in the Send tab, section of consecutive trials of the Properties form ?
Regards.
Jean-Serge
Hi Tumuzhuanjia,
It seems you are getting exceptions when you are executing try block. It may happen because your Third party system(Subscriber) is not working or taking longer than expected and you are using a for loop in your try block to initiate the second request.
I can't say with certainty what the problem is but if you can share the code from the try block, it would be easier to help you out.
Did you try this request from POST-MAN?
Regards,
Amit
Views
Replies
Total Likes
Hi Amit:
Thans for your reply.
I am making a unit test to my "try{}" code. So in my "try" it will "throw" errors according logic. So it is correct the code goto the "catch(e){}".
What I want is the standard of the "msgs.appendChild" when error happed. And when the address will be "Quarantine" ?
msgs.appendChild(<message
id={deliveryPart.message.@id}
status="?"
noRetry="true"
log={e.toString()}
failureReason="?"
failureType="?"/>);
And my code is the follow:
for each (var msg in deliveryPart.message)
{
try {
// get the service ID and mediaId
var woaId = NL.XTK.toString(msg.wechatService)
var mediaId = NL.XTK.toString(msg.wechatMedia)
if (woaId == null || woaId == "" || mediaId == null || mediaId == "")
{
throw "Parameter error: woaId = " + woaId + "; mediaId = " + mediaId
}
woaId = woaId.replace(BF_SERVICE_PREFIX, "")
//we saved the address with format "@openid + '@' + [service/@name]"
var address = NL.XTK.toString(msg.@address)
var addrArray = address.split('@', 2)
if (addrArray.length != 2)
continue
var openId = NL.XTK.toString(addrArray[0])
var tmpSubscriptionAccount = NL.XTK.toString(addrArray[1])
var tmpDeliveryAccount = NL.XTK.toString(msg.wechatService)
if (tmpSubscriptionAccount != tmpDeliveryAccount)
throw "Ignore"
var response
response = app.sendCustomerMsgByOpenid(woaId, openId, mediaId)
if (response == null || response.code == null)
throw "Internal Error: response or code is null."
if (response.code != 0)
throw response.message
msgs.appendChild(<message
id={msg.@id}
providerId={providerId}
status="1"
log="Sent"
/>)
}
catch (e)
{
log = e
if ( log == "Ignore" )
{
var excludeLog = "Ingored: not belong to the target wechat account " + BF_SERVICE_PREFIX + woaId
msgs.appendChild(<message id={msg.@id} status={0} log={excludeLog} noRetry="true"
providerId={providerId} />)
}
else
{
msgs.appendChild(<message id={msg.@id} status={2} log={log} noRetry="true"
providerId={providerId} failureReason="20" failureType="1" />)
}
}
}
Views
Replies
Total Likes
Hi tumuzhuanjia,
I don't know if the classic quarantine management for emails and SMS is valuable for the WeChat service, I don't know WeChat at all, but it should work as Facebook and Line channels more or less?
Anyway, please find the usual documentation in TechNotes here:
and also enumeration values and other explanations here:
Delivery and tracking
(I used these documentation past years, I don't know if it are useful for other channels).
One more thing, in your screenshot the line highlighted is "hard" type. Perhaps the WeChat service works as for MX or SMS platforms, by delivering feedback later and so putting it in hard bounce the quarantine record, after X soft bounces trial to resend (as for mails management ?).
How is defined the delivery WeChat in the Send tab, section of consecutive trials of the Properties form ?
Regards.
Jean-Serge
Views
Likes
Replies
Views
Likes
Replies