Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix #5: Subscribe with ADDRESS merge fields #6

Merged
merged 4 commits into from
May 27, 2018
Merged

Fix #5: Subscribe with ADDRESS merge fields #6

merged 4 commits into from
May 27, 2018

Conversation

ml-eds
Copy link
Contributor

@ml-eds ml-eds commented May 26, 2018

My suggestion to fix #5. What do you think?

Thanks a lot for starting the module!

@@ -32,11 +32,19 @@ class SubscribeToMailchimp extends WireData implements Module, ConfigurableModul
if(isset($email)) {
$api = $this->getApiBase($list, 'members');
$param['email_address'] = $email;

foreach ($merge_fields as $k => $v) {
if(!empty(trim($v))) { // avoid to override data of existing leads with empty field values
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! Trim produces a warning, if an array is given. Can you maybe switch these two somehow, so that the trim won't apply if you provide an array in $v?

@danielstieber danielstieber merged commit 6938e31 into danielstieber:master May 27, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subscribe with ADDRESS merge_field not working
2 participants