You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to use Formie for newsletter subscription with Double-Opt-In, integrated with CiviCRM. The Double-Opt-In is made up of two parts: The first opt-in and the second opt-in.
Here's the user story:
First opt-in to subscribe: User visits example.com, fills in a Formie form and clicks "Subscribe".
After this first opt-in, the user gets an second-opt-in-mail with a personalized link to confirm the subscription. The link points to a subscribe-confirmation-page on example.com.
Second opt-in to subscribe: Visiting the subscribe-confirmation-page automatically confirms the subscription, user gets a welcome-mail.
Unsubscribe: Every newsletter contains a personalized link to unsubscribe. The link points to a unsubscribe-confirmation-page on example.com.
Visiting the unsubscribe-confirmation-page automatically unsubscribes the user, user gets a bye-bye-mail.
What's your proposed solution?
CiviCRM comes with two different kinds of newsletter subscription management:
ANM comes with a comparatively complex management for newsletter subscriptions. We only want to implement a small and simple subset of the available functionality.
Step 1
formie needs to send a HTTP POST request with the following fields:
mailing_lists=[mailing_list_id] # configured in the formie config
email=[email_address] # mapped from the formie form
first_name=[first_name] # mapped from the formie form
last_name=[last_name] # mapped from the formie form
Step 2
is done by CiviCRM.
Step 3
The confirmation page contains a profile name and a contact checksum, for example example.com/newsletter/optin/[profile]/[contact_checksum]. The profile name is set in CiviCRM and needs to be configurable in the formie config. The page url may be set by formie and is configurable in CiviCRM. Visiting the confirmation page triggers a HTTP POST request with the following fields:
mailing_lists=[mailing_list_id] # configured in the formie config
contact_checksum=[contact_checksum] # extracted from the page url
contact_id=[contact_id] # extracted from the contact_checksum
autoconfirm=1 # always the same value
Step 4
is done by CiviCRM
Step 5
The confirmation page contains a profile name and a contact checksum, for example example.com/newsletter/unsubscribe/[profile]/[contact_checksum]. The profile name is set in CiviCRM and needs to be configurable in the formie config. The page url may be set by formie and is configurable in CiviCRM. Visiting the confirmation page triggers a HTTP POST request with the following fields:
mailing_lists=[mailing_list_id] # configured in the formie config
contact_checksum=[contact_checksum] # extracted from the page url
contact_id=[contact_id] # extracted from the contact_checksum
unsubscribe_all=1 # always the same value
Authentication
Every HTTP POST request additionaly contains the following fields (configured in the formie config):
api_key=[api_key] # in CiviCRM associated with a CiviCRM-contact, holding the appropriate access rights
key=[site_key] # specific to the connected CiviCRM instance
HTTP endpoint
The endpoint for the HTTP POST requests needs to be configured in the formie form. For a Drupal-based CiviCRM it would be https://example.com/civicrm/ajax/rest
Additional context
Formie needs to process all pages like example.com/newsletter/optin/default/*, where default is a configurable string and the actual value at * is evaluated to generate the HTTP POST request. Is that possible?
The text was updated successfully, but these errors were encountered:
What are you trying to do?
See also #2271
We want to use Formie for newsletter subscription with Double-Opt-In, integrated with CiviCRM. The Double-Opt-In is made up of two parts: The first opt-in and the second opt-in.
Here's the user story:
What's your proposed solution?
CiviCRM comes with two different kinds of newsletter subscription management:
We would like to integrate Formie with ANM.
ANM comes with a comparatively complex management for newsletter subscriptions. We only want to implement a small and simple subset of the available functionality.
Step 1
formie needs to send a HTTP POST request with the following fields:
mailing_lists=[mailing_list_id]
# configured in the formie configemail=[email_address]
# mapped from the formie formfirst_name=[first_name]
# mapped from the formie formlast_name=[last_name]
# mapped from the formie formStep 2
is done by CiviCRM.
Step 3
The confirmation page contains a profile name and a contact checksum, for example
example.com/newsletter/optin/[profile]/[contact_checksum]
. The profile name is set in CiviCRM and needs to be configurable in the formie config. The page url may be set by formie and is configurable in CiviCRM. Visiting the confirmation page triggers a HTTP POST request with the following fields:mailing_lists=[mailing_list_id]
# configured in the formie configcontact_checksum=[contact_checksum]
# extracted from the page urlcontact_id=[contact_id]
# extracted from the contact_checksumautoconfirm=1
# always the same valueStep 4
is done by CiviCRM
Step 5
The confirmation page contains a profile name and a contact checksum, for example
example.com/newsletter/unsubscribe/[profile]/[contact_checksum]
. The profile name is set in CiviCRM and needs to be configurable in the formie config. The page url may be set by formie and is configurable in CiviCRM. Visiting the confirmation page triggers a HTTP POST request with the following fields:mailing_lists=[mailing_list_id]
# configured in the formie configcontact_checksum=[contact_checksum]
# extracted from the page urlcontact_id=[contact_id]
# extracted from the contact_checksumnsubscribe_all=1
# always the same valueAuthentication
Every HTTP POST request additionaly contains the following fields (configured in the formie config):
api_key=[api_key]
# in CiviCRM associated with a CiviCRM-contact, holding the appropriate access rightskey=[site_key]
# specific to the connected CiviCRM instanceHTTP endpoint
The endpoint for the HTTP POST requests needs to be configured in the formie form. For a Drupal-based CiviCRM it would be https://example.com/civicrm/ajax/rest
Additional context
Formie needs to process all pages like
example.com/newsletter/optin/default/*
, wheredefault
is a configurable string and the actual value at*
is evaluated to generate the HTTP POST request. Is that possible?The text was updated successfully, but these errors were encountered: