Firebase icon indicating copy to clipboard operation
Firebase copied to clipboard

Adding lifecycle event to add existing users to Mailchimp audience

Open joehan opened this issue 3 years ago • 2 comments

Adds a lifecycle event to let users automatically add existing auth users to the specified Mailchimp audience.

I'm part of the Firebase Extensions team, and we recently added a new feature called lifecycle events that enables extensions to trigger functions whenever an instance is installed, configured, or updated. I wanted to make some code samples to show off the new feature, and this extension was a good example of an auth triggered extension. Feel free to edit this as you see fit - happy to help answer any questions about the code changes or the feature in general.

joehan avatar Dec 02 '22 21:12 joehan

Hi @joehan , thanks for contributing! New code looks good, thanks for that. We'll need to cover it with some tests first. I do wonder if theres a way we can also sync specified tags, activities and merge fields (specified by config) for users as well, otherwise artificial updates will still need to be performed to push all details to mailchimp. I'll have a think about whether this can be achieved.

barticus avatar Jan 03 '23 06:01 barticus

Hi @joehan , is there any way to test the new lifecycle hooks without deploying the extension currently? Currently I get this:

⚠  Unsupported function type on ext-mailchimp-firebase-sync-addExistingUsersToList. Expected either an httpsTrigger, eventTrigger, or blockingTrigger.
i  functions[{region}-ext-mailchimp-firebase-sync-addExistingUsersToList]: function ignored because the unknown emulator does not exist or is not running.

From what I have seen online this is using Cloud Tasks which there is no emulator for.

barticus avatar Apr 04 '23 01:04 barticus