Closed (fixed)
Project:
Webform
Version:
6.x-3.0-beta1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Jul 2009 at 20:19 UTC
Updated:
3 Apr 2010 at 03:27 UTC
Jump to comment: Most recent file
Comments
Comment #1
roball commentedHere is an updated version of "newsletter_email.inc" (Version 2009-07-21) with some bug fixes.
Comment #2
naught101 commentedsubscribe
Comment #3
roball commentedAttached is the patch mentioned in my starting post. The attached screenshot shows how the "Webform mail settings" section of the Webform node's [ Configuration ] tab then may look like.
Comment #4
Jackinloadup commentedsubscribe
Comment #5
roball commentednaught101 and jackinloadup, did you try this add-on? The only problem I am currently observing is when viewing a single submission result (at node/NID/submission/SID): The E-Mail field always shows the address of the logged-in user instead of the submitted address. Any clues on how to solve this?
Comment #6
Jackinloadup commented@roball
No i havent yet tested this. I used the previous method (http://drupal.org/node/127178#comment-754353) but havent had a chance to implement your version yet. I will review and comment when i get the chance.
Thanks for the submission.
Comment #7
naught101 commentedno, I haven't. Been doing some researching, thinking http://drupal.org/project/contact_manager + simplenews might be the way to go for me..
Comment #8
emdalton commentedsubscribe - I'll try to test this within the next few days.
Comment #9
haggins commentedThank you very much, works like a charm!
Comment #10
botrisSubscribe
Comment #11
Jackinloadup commentedIs it possible to to get this included in Webform?
Comment #12
emdalton commentedI tested the patch and it does seem to work. However, it doesn't allow the user to select which newsletter they wish to subscribe to. Could that be added as a form field or exposed somehow? Or would it make more sense to patch simplenews to be able to read a form field and decide which newsletters to send to which subscribers that way?
Comment #13
botrisThe patch works for me.
Right now it's an e-mail field, is there a way to change this to an select field?
In my situation, people leave their contact information, email, adres...
It would great to have an option "Subscribe to our news letter aswell? Yes / No"...
Please advise how to go about.
Comment #14
rukaya commentedI've changed newsletter_email.inc slightly so that it does what emdalton describes. I'll attach it here in case anybody else finds it useful. It should find each newsletter type and allow users to select with checkboxes which ones to sign up to. If more than one's selected it'll sign the user up to each of them.
Comment #15
UNarmed commentedCan the values added in the webform be used when i create a newsletter issue.
e.g if i have a field called subscriber name in the web form, can i use something like !subname in the body of the newsletters to personalise them?
Comment #16
gmreed commentedThis integration between webform and simplenews is a great idea, thanks! I have just been testing the modified newsletter_email.inc in #14 (allowing users to select which newsletters to subscribe to) and am getting the following error:
warning: Invalid argument supplied for foreach() in .../sites/all/modules/webform/webform_components.inc on line 587.
My setup is:
Core 6.13
Webform 6.x-2.9
Simplenews 6.x-1.0
I have applied the patch in #3 and first tested with the newsletter_email.inc file in #1 without encountering any problems.
Any ideas on how to correct would be much appreciated. Thanks.
Comment #17
UNarmed commentedHow do i get the webform to send the added information to simplenews subscriptions??
Also i am getting the following error it thats perhaps why it is not working for me.
warning: Invalid argument supplied for foreach() in /home/ehbeatco/public_html/marketing_club/sites/all/modules/webform/webform_components.inc on line 587.
Much thanks
Comment #18
tchopshop commentedHello,
I'm getting the same foreach () error on line 587 as #16 and #17 when applying the patch from #14. Please advise...
thanks
Elena
Comment #19
UNarmed commentedLooks like all 3 of us are in the same boat =/
Help would be much appreciated.
Comment #20
roball commentedHere are both the "newsletter_email.inc" file and the patch tested with the latest Webform 6.x-3.x and Simplenews 6.x-2.x dev versions.
Comment #21
UNarmed commentedThanks a lot il give this a try and report back.
Comment #22
UNarmed commentedHmmm i have used the exact same module versions as you and i have installed the patches. For some reason the webform dosent send the e-mail address to the simplenews subscriptions section.
Comment #23
wroxbox commentedSubscribe
Comment #24
mlncn commentedGreat work Rob!
I think you meant http://drupal.org/files/issues/webform__newsletter_email.patch for the patch (rather than the print module support patch). That one still applies (with an offset of -142)!
If this is not accepted into Webform, is it possible to have webform recognize components stored elsewhere? Perhaps this can go into Simplenews or if absolutely necessary a completely new module.
benjamin, agaric
Comment #25
roball commentedOops - yes Benjamin - I have mixed up two separate issues. The correct patch tested with the latest 6.x-3.x-dev version of Webform is attached to this post.
Comment #26
quicksketchIt's unlikely that this will be added to Webform. However, a patch to allow other modules to provide components is at #151603: Can I put options in a select field from a database query?, which I plan on adding.
Comment #27
quicksketchThis will not be added to Webform core. The 3.x version now supports a public API that allows any module to provide components. I'd suggest seeing if SimpleNews is interested in including the integration, otherwise I'd suggest creating a new project that includes this code.
See #340241: Provide hook_webform_component_info() to allow 3rd-party components for information about the new hook, and check out the API information: http://drupalcode.org/viewvc/drupal/contributions/modules/webform/webfor...
Comment #28
pcambraHi
I've adapted the code provided above in a new module called Webform Simplenews Component (http://drupal.org/project/webform_simplenews) and I'm testing it in my last site. It uses the new Webform 3.x API.
But I've found myself stuck in one last thing, as the newsletter email component I've created is in fact an email, I don't see the way to add it to the email configuration tab of Webform options, I've dug into the webform module code and I've found a couple of things there:
In webform.emails.inc, webform_emails_form there is this code:
And that function _webform_component_options in webform.module is like this
So I think that there is no way for a "contributed" component to add email form settings through the API, maybe if we add a call to another function in _webform_component_options that can modify the behavior of the $acceptable_types this would be possible. Perhaps adding a extra setting in _webform_defaults_component() API call in order to establish if the component has those email settings could be a good idea too.
What do you think?
Comment #29
quicksketchSounds awesome pcambra! Thanks for taking the initiative on providing this functionality. What you're reporting definitely sounds like a difficiency in the APIs. Here's a patch that extends our existing hook_webform_component_info() to include information about which fields are suitable for e-mail names, addressess, and subjects. All you need to do is add a few extra properties to your implementation of hook_webform_component_info().
Comment #30
quicksketchI've committed the patch from #29. In your hook_webform_component_info(), just add the "email_address" feature to your component definition.
Comment #31
pcambraThanks quicksketch! I've updated my module as well including the email_address definition.
Comment #32
roball commentedGreat! Will give it a try maybe when the next beta is out. Thank you quicksketch and pcambra.
Comment #33
roball commentedNow where the awesome Webform 6.x-3.0-beta2 is out containg this updated API, I am waiting for Webform Simplenews Component's #731614: First beta? to get it tested.
Comment #34
kostajh commentedmoved the comment here: #151603: Can I put options in a select field from a database query?
Comment #36
quicksketchMoving this back to beta1 (the version this feature was built-upon), meaning beta 2 was the first version to include it.