2

I have created the newsletter subscriber group on customer group, so I can apply discount to them, is there anyway to make it automatic, if someone subscribe to newsletter he/she automatically assign to newsletter subscribers group that had created?

1
  • hello you there. please accept the answer if it helped you to resolve your problem. Nov 8, 2014 at 6:02

1 Answer 1

2

What you could do is listen to the event for customer save before customer_save_before, check to see if they are subscribing to the newsletter, If they are then you can update the group assigned to the customer and they will be saved into this new group.

The attribute for newsletter subscription is is_subscribed and you can call setCustomerGroupId on the customer object to update the group.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.