Share your ideas

Bug fixes for addRecipient API call

Many of our clients have issues with using the addRecipient call to add a contact to a contact list. A developer for one of our clients found some bugs and has provided fixes on GitHub. See below info from the developer. Thank you!

.............................................................................................................................................................................................................

I've gotten things to work, but had to work outside the engage API because I could not get things to work with only the subset of API functionality provided by the Node package. I've opened 2 bug reports / feature requests for the workarounds I had to implement locally in order to get things working.

1.addRecipient incorrectly formats CONTACT_LISTS in XML request * Issue #18 * Silverpop/node-engage https://share.polymail.io/v1/z/b/NWIyZDg1Y2E5NTJh/lzh1f32gbMT7Ict5TlNrUJGTpVgbwueZDJZOsagpuofhbcvOTmRzASo_Ao655a1goqriychAmP1jsoH3LlRgMq2yN1aoHwYyrzoPnflSd0MJvnc59W3-A0oe8qZWqfF2vUp62sI1qP2KIbBjAojU2B4HsalPmgP3F4yRtOyZBdDsrwai0JAwSX7f0R6OiQTkE_WTTh8TrWj9BdqZMJYfCAWh

Cannot add a recipient specifying the contactLists option because the child items of CONTACT_LISTS is malformed. Currently being added as an array index, not CONTACT_LIST_ID. Can be fixed by adding the following to add-recipient.js if (t... https://share.polymail.io/v1/z/b/NWIyZDg1Y2E5NTJh/lzh1f32gbMT7Ict5TlNrUJGTpVgbwueZDJZOsagpuofhbcvOTmRzASo_Ao655a1goqriychAmP1jsoH3LlRgMq2yN1aoHwYyrzoPnflSd0MJvnc59W3-A0oe8qZWqfF2vUp62sI1qP2KIbBjAojU2B4HsalPmgP3F4yRtOyZBdDsrwai0JAwSX7f0R6OiQTkE_WTTh8TrWj9BdqZMJYfCAWh

GITHUB.COM https://share.polymail.io/v1/z/b/NWIyZDg1Y2E5NTJh/lzh1f32gbMT7Ict5TlNrUJGTpVgbwueZDJZOsagpuofhbcvOTmRzASo_Ao655a1goqriychAmP1jsoH3LlRgMq2yN1aoHwYyrzoPnflSd0MJvnc59W3-A0oe8qZWqfF2vUp62sI1qP2KIbBjAojU2B4HsalPmgP3F4yRtOyZBdDsrwai0JAwSX7f0R6OiQTkE_WTTh8TrWj9BdqZMJYfCAWh

2. RemoveRecipient is not implemented * Issue #19 * Silverpop/node-engage https://share.polymail.io/v1/z/b/NWIyZDg1Y2E5NTJh/lzh1f32gbMT7Ict5TlNrUJGTpVgbwueZDJZOsagpuofhbcvOTmRzASo_Ao655a1goqriychAmP1jsoH3LlRgMq2yN1aoHwYyrzoPnflSd0MJvnc59W3-A0oe8qZWqfF2vUp62sI1qP2KIbBjAojU2B4HsalPmgP3F4yRtOyZBdDsrwai0JAwSX7f0R6OiQTkE_TU4Z7-vCxqKehPBbBqKly1
Has this been deprecated? If so, how can we remove recipients from contact lists if opt-out is a global concept? I solved this locally by creating a remove-recipient.js class in the xml-api folder. https://share.polymail.io/v1/z/b/NWIyZDg1Y2E5NTJh/lzh1f32gbMT7Ict5TlNrUJGTpVgbwueZDJZOsagpuofhbcvOTmRzASo_Ao655a1goqriychAmP1jsoH3LlRgMq2yN1aoHwYyrzoPnflSd0MJvnc59W3-A0oe8qZWqfF2vUp62sI1qP2KIbBjAojU2B4HsalPmgP3F4yRtOyZBdDsrwai0JAwSX7f0R6OiQTkE_TU4Z7-vCxqKehPBbBqKly1

GITHUB.COM https://share.polymail.io/v1/z/b/NWIyZDg1Y2E5NTJh/lzh1f32gbMT7Ict5TlNrUJGTpVgbwueZDJZOsagpuofhbcvOTmRzASo_Ao655a1goqriychAmP1jsoH3LlRgMq2yN1aoHwYyrzoPnflSd0MJvnc59W3-A0oe8qZWqfF2vUp62sI1qP2KIbBjAojU2B4HsalPmgP3F4yRtOyZBdDsrwai0JAwSX7f0R6OiQTkE_TU4Z7-vCxqKehPBbBqKly1

To recap what I ran into with the approach you suggested, if I use addRecipient directly to add the contact to a contact list, it fails because of issue #18 above. Once I implemented the fix described in the bug report, it became clear that this is an "add-only" feature; any contact lists included would be added, but the system will not remove lists that are not included. Therefore, I had to implement a Node version of RemoveRecipient (described in issue #19 above). Once this was in, I could handle things appropriately by programmatically removing undesired contact lists and adding newly selected ones.

I would love to be able to commit these fixes to the codebase and get a new version of the API released to npm so we don't have to maintain a modified version of the Engage API. Is this something you'd be able to look into? I have branches ready to commit, but I don't have permissions to do so.

  • Kristin Connors
  • Feb 26 2020
  • Shipped
What is your industry? Travel & Transportation
What is the idea priority? High