At this moment per list 2 URL's are defined: an unsubscribe URL (UnsubscribePage) and a confirmation URL (ConfirmationSuccessPage). But when a list has the ConfirmedOptIn checkbox checked, it would be nice if an extra form field appeared to enter the URL of a page which says something like "Thank you for subscribing! We sent you a confirmation email, etc.".

I tried to add this extra URL (ConfirmedOptInPage):

  1. includes/campaignmonitor_list.admin.inc: I added text fields to the Create list and Edit list forms, form states show / hide this field;
  2. includes/campaignmonitor_list.admin.inc: The other 2 URL's (UnsubscribePage and ConfirmationSuccessPage) are stored at Campaign Monitor's servers, but this URL had to be stored in this list's options variable. The Create list form did not save any values in the list options variable yet, so I added this for this field. And the Edit list form removed all fields in the Options fieldset before saving, I manually added the new field's value to the lists' options variable;
  3. campaignmonitor.module and module/campaignmonitor_user.module: I altered the argument of the goto() depending on whether ConfirmedOptIn is checked and ConfirmedOptInPage is defined;
  4. lib/campaignmonitor.class.inc: createList() returned a true value on success, I changed this into the list id so the caller receives the list id. With this list id I could save ConfirmedOptInPage in the list's options variable on Create list form submit.

I hope this addition makes any sense and since I am fairly new to Git / diffs / patches, I also hope the attached diff is okay.

Cheers.

Comments

cableman0408’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Needs work

The diff looks like its binary or something. I'm unable to read it.

How have you created the diff ?

lmeurs’s picture

I used git diff.

When I download the file, it looks like all other diffs I have seen before... Do you see something like:

diff --git a/campaignmonitor.module b/campaignmonitor.module
index c756198..e30bebb 100644
--- a/campaignmonitor.module
+++ b/campaignmonitor.module
@@ -399,6 +399,7 @@ function campaignmonitor_subscribe_form($form, &$form_state, $list_id) {
  * if the API call fails.
  */
 function campaignmonitor_subscribe_form_submit($form, &$form_state) {
+
   // Get a Campaign Monitor object.
   $cm = CampaignMonitor::getConnector();

...etc...
cableman0408’s picture

StatusFileSize
new61.31 KB

That's strange, maybe it's the encoding. See the screenshot...

lmeurs’s picture

StatusFileSize
new8.94 KB

That is strange. Chrome opened the file fine, Firefox showed the same as with you. Appeared the encoding was set to "Little Indian", I converted it to UTF-8 without BOM, attached the file to this post and tested it succesfully in Firefox.

EDIT: has something to do with GIT / Powershell / Windows.

bdawg8569’s picture

I used the patch in #4 and it worked great for me. The only suggestion I might have is to allow the user to configure the text that gets output in a drupal_set_message for confirmations, but that is not a big deal. Great patch! thanks!

lmeurs’s picture

Status: Needs work » Needs review
StatusFileSize
new8.43 KB

Manually rerolled patch against current dev. I undid some errors in previous patch and cleaned up the code.

To anyone who applied the previous patch, after applying the latest patch you will have to set the Confirmed Opt In message page URL again for each list.

The patch contains a small API change: CampaignMonitor::createList() no longer returns TRUE on success, but the newly created list's ID.

@bdawg8569: I think that is out of this issue's scope , you could always overwrite any strings from the settings.php file.

vladimiraus’s picture

Status: Needs review » Closed (outdated)

Drupal 7 is no longer supported.
Closing as outdated.