progressivetech / net.ourpowerbase.remoteform

Remoteform allows you to easily create CiviCRM forms on a remote web site using a few lines of javascript code.
Other
13 stars 8 forks source link

Double Opt-in for Profiles which use the "Add to Group" setting #56

Closed graceolivia closed 1 month ago

graceolivia commented 1 month ago

Hi! Thanks for the help with my last issue, I'm back with another question!

Environment:

Drupal Version: 10

Description

When I am using RemoteForms and I have a profile form that adds a user to a group and have the "Enable Double Opt-in for Profiles which use the 'Add to Group' setting" checked in my CiviCRM CiviMail Component Settings, the opt-in email is not sent and the user is automatically added to the group without double opt-in.

Steps To Reproduce

  1. Create Profile form that accepts email as a field (not primary email. I used "Main Email") and has RemoteForm enabled.
  2. While making the profile, go to Advanced Settings and enable "Add contacts to group?" for some group
  3. In the CiviCRM menu, go to Administer -> CiviMail -> CiviMail Component Settings. Check the box next to "Enable Double Opt-in for Profiles which use the 'Add to Group' setting"
  4. Embed RemoteForm on host website. Submit email.
  5. Receive regular "Thank you! Your submission was received" green message in the RemoteForm

Then what happens for me is:

  1. No Opt-In email for the group is sent
  2. A new contact is created and it's already in the group.

Other information

This is accompanied by 3 errors in the CiviCRM host Drupal error logs. All three have Location: [the civicrm website url]/civicrm/remoteform and Referer: [the host website url]

Warning: Undefined array key "thankyou_text" in _rf_add_page_details() (line 78 of /pathtoCiviCRM/web/sites/default/files/civicrm/ext/net.ourpowerbase.remoteform/api/v3/RemoteFormContributionPage/Submit.php)

Warning: Undefined array key "intro_text" in _rf_add_page_details() (line 77 of /pathtoCiviCRM/web/sites/default/files/civicrm/ext/net.ourpowerbase.remoteform/api/v3/RemoteFormContributionPage/Submit.php)

Warning: Undefined array key "thankyou_text" in _rf_add_page_details() (line 78 of /pathtoCiviCRM/web/sites/default/files/civicrm/ext/net.ourpowerbase.remoteform/api/v3/RemoteFormContributionPage/Submit.php)

Thank you for the help, let me know if you have any other questions!

jmcclelland commented 1 month ago

Oh yes, I can see that this won't work with Remote Form :(. I'm sorry! RemoteForm is a very manually replication of what CiviCRM does. I started with just the basic features and simply have not had enough time to add more. Unfortunately, it's unlikely I will be able to add this feature.

There has recently been a lot of work on embedding forms in CiviCRM Core - once that work is complete, RemoteForm will be obsolete - which is one of the reasons I have been hesitant to invest more time or energy into this extension.

graceolivia commented 1 month ago

Ah, I see, thank you for letting me know! That's good info to have.