Closed (won't fix)
Project:
Campaign Monitor
Version:
6.x-2.2
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
13 Feb 2009 at 10:50 UTC
Updated:
18 Nov 2020 at 04:12 UTC
Jump to comment: Most recent
Comments
Comment #1
ssherriff commentedAt the moment the module gives you the possibility to have a checkbox on the registration page and/or the contact page.
Comment #2
modulist commentedBoth the contact page and the registration are pretty kludgey in their implementation. Webform allows you to change the URL, redirect page and a number of other features.
I was also under the impression that we could add various fields to match segments with this module.
Comment #3
rickvug commentedSince this functionality doesn't existing, I'm changing this to a feature request.
Comment #4
Michsk commentedi would also be intersted in this
Comment #5
dries arnoldsI'm also interested. It's a much requested feature that clients have.
Right now I'm filtering csv results from webform submissions and importing those manually in Campaign Monitor.
Comment #6
ssherriff commentedOk, as several people have asked for this, I will have a look at including this in the module.
Comment #7
ssherriff commentedWith this feature request, could someone who has more experience using webforms help define the actual feature request a bit more. Did you just want the capability to add a newsletter or newsletter checkboxes to the bottom of the form, or did you want some other more complicated way of actually having a specific 'campaignmonitor' field that can be added to forms. I'll have to do a bit more research to get this one right, so any information someone might want to provide will definitely help.
Cheers
Comment #8
rickvug commented@ssherriff I see a simple checkbox as being sufficient. The more challenging aspect of the integration will be selecting which fields contain the name and email address to be sent to Campaign Monitor. IMO, any further webform related feature requests should be filed as separate issues at a later date.
Comment #9
iancawthorne commentedThe captcha module might be worth looking at as this adds itself to any form.
Comment #10
epersonae2 commentedCheckbox(es) to indicate which list(s) to subscribe, and a way to indicate which fields should also be sent would be a good thing.
BTW, for those looking for a right now implementation, I figured out a (somewhat cludgy) way to do it with Additional Processing. Let me know if there's interest, and I'd be happy to share! :)
Comment #11
cnolle commentedHey,
I would definitely be interested, been trying to work this out for the last couple of days with no luck.
-- Christian
Comment #12
rickvug commented@epersonae2 You are welcome to share your solution, no matter how cludgy it is.
Comment #13
epersonae2 commentedOK, here's what I've got. It's not on a production site yet, so I can't say if there's anything weird that might happen with more visitors.
This code, including the PHP tags, goes in Additional Processing. I used the Create a subscribe form feature in Campaign Monitor to get the value for the field names and the url to submit.
I hope this is helpful!
Comment #14
cnolle commented@epersonae2 Thanks for that. Works wonderfully. Good stufF.
Comment #15
rjperry25 commentedFrom a marketeers perspective (I'm not a coder) but I use Drupal for my clients.
I use the webforms for capturing visitors data. If I could send the following data
name, email, tel - the usual stuff
plus and this is what I really could do with - is a menu list that can be used to segment the user in to a subscibers list within Campaign Monitor. You can identify each subscriber list by using the API Subscriber List ID (found in the admin area of CM)
Not sure how it can be done but you'll need to replicate the subscribers list in Campaign Monitor with the list in webform.
This would be very interesting and I could possibly fund some development time. If anyone is interested.
Comment #16
modulist commentedThis would imply being able to pass the value of webform or CCK fields to Campaign Monitor.
I agree, it's a really importanrt way of adding subscribers to the proper segments.
Comment #17
nickorr commentedThis is something I'm looking for as well.
All I'd want is an option to be able to add them to the existing webforms. In terms of UI, I'd have the same UI you've already got for Contact and Registration checkboxes, but add a list of existing webforms to those 2 items. So you'd just turn it on or off there. Make sense?
Thanks,
Nick
Comment #18
ssherriff commentedYeah, I think it is harder then that though because people will probably have form elements on their webform that they want to use to fill custom fields (including the Name field). So really I'd have to possibly get the available webforms, plus the fields available and enable mapping. That might be complicated.
Any hints/tips by people who have experience with webforms are greatly appreciated at this point.
Cheers,
Stephanie
Comment #19
Michsk commentedMaybe team up with http://drupal.org/project/emf there's some great mapping options in there.
Comment #20
deanloh commentedNice work on this! I used Webform to create a contact form and added this code to Additional Processing field. Problem is, every time someone submitted the form, his email address is added to Campaign Monitor. So I added a checkbox to let user to check if they want to subscribe to mailing list. The field name of the checkbox is "subscribe" and value is "opt_in", therefore I modified the code this way:
Somehow this didn't seem to work, the form still sent all data to CM regardless the checkbox is checked or not. What do you think I have missed here?
Comment #21
deanloh commentedI had eventually found the answer myself, instead of:
if ($form['submitted']['subscribe']['#value'] = "opt_in") {I changed it to:
if ($form['submitted']['subscribe']['#value']) {and problem solved!
So the full code is:
I hope this is helpful for anyone else who was looking for the same. Feel free to enhance this if you will. Thanks again to epersonae2 who originated this tip!
Comment #22
baronmunchowsen commentedCode in #21 works awesome for me. Thanks to all involved putting this together. I added a message after the drupal_http_request to let the user know that they've been subscribed:
Comment #23
james-oppenheim commentedThanks for that, the code above worked a treat. Super easy!
Comment #24
quasi commentedHi, I can't get this code to work. The data just doesn't get to my CM account.
Anything I should be careful about?
Does this approach even need the Campaign Monitor module?
Comment #25
quasi commentedI had my fields in a fieldset so
$form['submitted']['email']['#value']becomes:
$form['submitted']['fieldset']['email']['#value']And the answer to my second question is no.
Thank you for this wonderful solution!
Comment #26
nosro commentedUsing the technique from #21, I found that you can also subscribe via the campaign monitor module if you want to:
Comment #27
rocketfuel commentedThanks to everyone who contributed to this thread, you saved me a lot of heartache. Have a great weekend!
Comment #28
rimian commentedYes, this is how I did it (Webform > Config > Advanced Settings > Additional Processing). My code is like this:
I've got a few suggestions for this:
I'd refactor
_campaignmonitor_add_subscribertocampaignmonitor_add_subscriber. I don't see why this function can't be used as an interface for other modules like webform. This module only has the formAPI as an interface. Fix that and half your problems go away.Should the $api_key be a mandatory argument for this function? Why not have something like:
Comment #29
hessam61 commentedThanks deanloh. Post #21 worked for me and I was able to send the information from webform to the Campaign Monitor. The only problem is I get a white screen after submitting the form. Am I missing something?
Comment #30
summit commentedSubscribing, greetings, Martijn
Comment #31
sarhansg commentedThis is something i've been looking for. Read an alternative method on another site which you can find at http://houseoflaudanum.com/navigate/howtos/add-campaign-monitor-opt-in-u... . Not sure if I did something wrong but it simply didn't work for me.
I've installed the following modules:
Problem is, based on the link above, Webform 3.x has done away with the Additional/Advance Processing required by most of the techniques offered in this thread. Unfortunately, I cannot revert to an older version of Webform.
Should anybody have a solution I'd be more than happy to try.
Comment #32
gambryFrom: http://drupal.org/project/webform
- The Additional Processing and Validation code options have moved to a separate project. Webform PHP.
Could it help?
Comment #33
bdiddymc commentedI have tested this on a basic webform for a site I need to set up, and it seemed to work so far. (Thanks for the link!)
Did you:
- Generate a subscribe form in the Campaing monitor system?
- make sure to set the url for the campaign monitor form in the module (line 21).
- Replace the hyphens with underscores for the webform Field Keys (and have them match the names in the CM generated form).
- Did you set up a check box with "cm-opt-in|I would like to sign up" option
Guessing one of those has been missed.
(this is the reply to #31 by the way)
Comment #34
sarhansg commentedThanks bdiddymc. Looking at your suggestions I realised I didn't include the cm-opt-in option in my webform. I did try adding it but to no avail. I even tried changing it to cm_opt_in but it still didn't work. Any other ideas?
Comment #35
seancorrales commentedJust an update for all your campaign monitor users: it looks like the method a lot of people are recommending (create a form URL and POST the values to it) won't work. Campaign Monitor has started requiring users to fill out a CAPTCHA and confirm their email address before it'll accept the submission.
Comment #36
sarhansg commentedThanks for the information droidenator. That brings us all to square one. Any solutions people?
Comment #37
alexreinhart commentedI've been working on a complete solution to this problem by using Campaign Monitor's API to submit the webform data directly. It also allows for users to edit their Campaign Monitor preferences (and unsubscribe and such) through a custom webform. Would this module's maintainers be interested in collaborating on getting this included?
Comment #38
cableman0408 commentedHi Alex
If you have a solution to this, I will be happy to help in getting this included into the module. But you should be aware that I have added some new functionality into the module and re-factored parts of the code the last 2 weeks. So you should checkout the newest version from 6.x-3.x-dev
Comment #39
alexreinhart commentedHm. One problem is that I'm using the latest Campaign Monitor PHP wrapper, which is substantially different from the version your module seems to use. Are you planning to update to the new version at any point? I've found it relatively easy to work with.
Also, Webform provides capabilities which essentially duplicate this module's features -- it can provide forms in blocks or in nodes, so a simple "subscribe" block can be easily created without rebuilding Webform's extensive features. I'm not sure what approach you'd want to take to handling this duplication.
Comment #40
cableman0408 commentedI have just started on the D7 version and think that we should use the latest Campaign Monitor PHP wrapper for it. Based on the "issues" with this I'll look into getting the 6.x-3.x branch updated to use it as well.
I don't think that the Campaign Monitor module should be dependent on Webforms as many sites do not use the webforms module. So I do not see this as a duplication of features, but more an extension of the module to easily integrate with webforms.
Comment #41
alexreinhart commentedHm, that sounds good. The Webform integration code shouldn't care much about Drupal version, so when your D7 version moves to the new API I could make a patch to integrate the Webform features with it. Later, it could be backported to 6.x relatively easily. The Webform stuff could be hidden behind a configuration switch for those users who don't have or want Webform on their sites.
One aside, though: My development is sponsored by a Drupal-based web design company, and their support is contingent upon getting a little note of sponsorship, like we've done with our other module. I hope that's fine with you.
Comment #42
alexreinhart commentedAlternately I suppose the Webform integration could be put in as a submodule, so it could be enabled or disabled through the ordinary module interface. That would provide a nice logical separation of the code, while still allowing sharing of core features.
Comment #43
sarhansg commentedLooking forward to this development. Good luck!
Comment #44
cableman0408 commentedI think that it should be a sub-module, but you should wait until I have complete the new API layer.
In regards to the sponsorship link, I will have to ask ssherriff
Comment #45
alexreinhart commentedOkay, that sounds good. Just ping me when the new API layer is ready and I can start porting over to it.
Comment #46
artis commentedcableman0408, I'm helping alexrienhart with this module (just ported it to D7) and was wondering if you've completed your changes on the API layer so we can get the submodule finished and contributed?
Thanks.
Comment #47
cableman0408 commentedThe D7 version is using the Campaign monitor v3 API, which I have create a wrapper class around in http://drupalcode.org/project/campaignmonitor.git/blob/refs/heads/7.x-1.... to create a Drupal abstraction layer.
I'm not planing any changes to this layer before a finale 1.0 release :-) I have however not found the time to back port the new layer to the 6.x-3.x branch.
Hope this helps :-)
Comment #48
albert volkman commentedToday I needed to add campaign monitor to a webform. Following the concept of #26 but using the object found in the campaignmonitor module, I did-
Works great! Replace the <values> per your webform. Remember to duplicate nested values in your webform as multilevel arrays.
Comment #49
jorgegc commentedHey guys, I have created a sandbox that does exactly what you are after. The only problem is that it hasn't been ported to D6 yet but I am happy to do it if you guys help me get it to Drupal.org.
Check it out and let me know your thoughts! Cheers
http://drupal.org/sandbox/jorgegc/1530816
Comment #50
summit commentedHi @jorgegc; this looks great! Yes please for porting to D6!
Greetings, Martijn
Comment #51
jorgegc commentedHey Martijn, are you able to help out and review the D7 version? Cheers
Comment #52
summit commentedHi @jorgegc. I am not using campaign monitor on my first Drupal 7 site. I will see if this is a good thing to install and then see if webform helps out. I can not promise this in the short term.
I use campaign monitor on a D6 site, but that doesn't help you I think.
greetings, Martijn
Comment #53
jorgegc commentedHi Martijn,
A bit of good news for you... I have ported the module to Drupal 6. If you could give that a go that would be great! Any feedback is muchly appreciated :-)
http://drupal.org/node/1530816/git-instructions/6.x-1.x
Cheers,
Jorge
Comment #54
symphonia commented@deanloh: thank you for the code... but I just can't find the Campaign Monitor form URL... could you tell me please where I can find it?
Edit: I found it.
Comment #55
vladimirausClosing 6.x issues