CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • CiviMail Subscribe Block?
Pages: [1] 2

Author Topic: CiviMail Subscribe Block?  (Read 13298 times)

preacherboy86

  • I’m new here
  • *
  • Posts: 24
  • Karma: 1
CiviMail Subscribe Block?
January 19, 2008, 03:29:11 pm
Hey folks,

Is there a way to set up a CiviMail subscribe block so anonymous users and guests can simply type their email address or their first and last name and email address and subscribe to a particular group? Thanks!

msn

  • I post frequently
  • ***
  • Posts: 152
  • Karma: 6
  • Please talk to the other site
Re: CiviMail Subscribe Block?
January 19, 2008, 03:47:00 pm
There is a Drupal module with a subscribe block: http://drupal.org/project/civicrm_subscribe
Otherwise you have to make a profile and place it in a block.
Please search the forum for 'newsletter' there is a lot written about this issue.

 




preacherboy86

  • I’m new here
  • *
  • Posts: 24
  • Karma: 1
Re: CiviMail Subscribe Block?
January 19, 2008, 06:06:03 pm
Thanks. I hadn't thought of searching for an appropriate Drupal module. I'll remember that next time I have an issue. Thanks again!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: CiviMail Subscribe Block?
January 20, 2008, 02:24:13 pm
Starting with 1.9 - you can also direct folks to a CiviMail "subscribe" web page. This can be configured to allow signup for any public mailing - OR limited to a specific group. This feature isn't documented nicely yet :-( - altho it is described in the 1.8 to 1.9 upgrade docs:

http://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+Drupal+Sites+from+v1.8+to+v1.9#UpgradingDrupalSitesfromv1.8tov1.9-13.CiviMailUsersUpdateAutomatedMessagesandSelectMailingListGroups

We'll get some doc for this in as we upgrade docs for 2.0.

You can see examples of this page in both modes on the 1.9 demo:
* Specify a group ID in the URL - signup is for a specific group:
http://demo.civicrm.org/drupal/civicrm/mailing/subscribe?reset=1&gid=2

* No group ID in the URL - all public mailing list groups are listed:
http://demo.civicrm.org/drupal/civicrm/mailing/subscribe?reset=1

In either case, the user will get a confirmation request email which they can reply to OR click the confirm URL (they are in "Pending" status until they confirm).
Protect your investment in CiviCRM by  becoming a Member!

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: CiviMail Subscribe Block?
February 11, 2008, 07:22:48 am
I too am interested in getting this data into a block as opposed to having to click and be redirected to a page in Drupal. Specifically, when you want to subscribe to just one group (civicrm/mailing/subscribe?reset=1&gid=somenumber) and the page just has a text field for email address and a subscribe button, I would like to put THIS code into a block so on every page there is a block that says something like "Subscribe to our newsletter!" with just the text box and submit button. On clicking submit it could do what it does now by taking you to the home page.

Part II of this development could be: if a user is logged in and already subscribed to a group, the block has an unsubscribe option instead (would also love to see this in the page component as is now).

Perhaps this is a CiviNode feature request if not appropriate for CiviCRM development?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: CiviMail Subscribe Block?
February 12, 2008, 08:32:14 am
Emily - Have you experimented with pasting the HTML form code from the "full page" and putting it in a block to see if it works properly. Not sure, but it might... The other functionality (unsub option if logged in user is subscribed) could probably be handled in the block with a few API calls.

If you decide to dive in on this and get something working - please post back here and also put up a "recipe" on the wiki :-)
Protect your investment in CiviCRM by  becoming a Member!

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: CiviMail Subscribe Block?
February 22, 2008, 10:46:30 am
Excellent idea. I am attempting to paste in html code and get it down to a reasonable look. After pressing submit, it fails on the subscribe page.

Here's what I have in my Drupal block:
Code: [Select]
<script type="text/javascript" src="http://burlington.cctv.org/sites/all/modules/civicrm/js/Common.js"></script>
 
<!-- .tpl file invoked: CRM/Mailing/Form/Subscribe.tpl. Call via form.tpl if we have a form in the page. -->
    <form  action="http://burlington.cctv.org/civicrm/mailing/subscribe" method="post" name="Subscribe" id="Subscribe" >
  <div><input name="qfKey" type="hidden" value="a3eac52934c2d18558e05948fdee5e3e" />
<input name="_qf_default" type="hidden" value="Subscribe:next" />
</div>
   <label for="email">  Email
   </label><input maxlength="64" size="10" name="email" type="text" id="email" class="form-text big required" />
 <input class="form-submit default" name="_qf_Subscribe_next" value="Subscribe" type="submit" />
</form>


And here is the backtrace error I get upon submitting :(
Code: [Select]
backTrace

/var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 255
/var/www/html/sites/all/modules/civicrm/CRM/Core/Controller.php, fatal, 182
/var/www/html/sites/all/modules/civicrm/CRM/Core/Controller.php, key, 136
/var/www/html/sites/all/modules/civicrm/CRM/Core/Controller/Simple.php, __construct, 59
/var/www/html/sites/all/modules/civicrm/CRM/Utils/Wrapper.php, __construct, 75
/var/www/html/sites/all/modules/civicrm/CRM/Mailing/Invoke.php, run, 85
/var/www/html/sites/all/modules/civicrm/CRM/Core/Component.php(183) : eval()'d code, main, 1
/var/www/html/sites/all/modules/civicrm/CRM/Core/Component.php, eval, 183
/var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php, invoke, 144
/var/www/html/sites/all/modules/civicrm/drupal/civicrm.module, invoke, 319
, civicrm_invoke,
/var/www/html/includes/menu.inc, call_user_func_array, 418
/var/www/html/index.php, menu_execute_active_handler, 15

unrecoverable error
    Sorry. A non-recoverable error has occurred.

    Could not find valid Key

    Return to home page.

Any ideas of what this is about?


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviMail Subscribe Block?
February 22, 2008, 01:46:41 pm

I suspect this is a bug in civicrm, and we should disable the qfKey check (to prevent session hijack) for the subscribe url. can you verify this against our 2.0 demo and if so file an issue.

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

tonyg

  • Guest
Re: CiviMail Subscribe Block?
February 23, 2008, 09:20:59 pm
Hi Dave.

Would it be possible to tell me how to set up the two example subscribe forms in 1.9 you cite? or at least point me in the right direction.

thanks in advance!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: CiviMail Subscribe Block?
February 24, 2008, 06:55:26 pm
Hi Tony  - Are you asking about the "built-in" CiviMail mailing list subscription forms? If so... assuming Drupal + CiviCRM - you just need to provide links for folks to the following URLs:

* If you specify a group ID in the URL (gid=x) - signup is for a specific group:
http://<your drupal site>/civicrm/mailing/subscribe?reset=1&gid=2

* If no group ID in the URL - all PUBLIC visibility, mailing list type groups are listed:
http://<your drupal site>/civicrm/mailing/subscribe?reset=1

If you want this to be available to anonymous users - make sure the "access CiviMail subscribe/unsubscribe pages" is enabled for that role (under Drupal >> Admin >> User >> Access Control).
Protect your investment in CiviCRM by  becoming a Member!

tonyg

  • Guest
Re: CiviMail Subscribe Block?
February 25, 2008, 01:46:08 pm
Yup. that was what i was asking and this really helps.  One more question: are these pages configurable in terms of adding profiles (like contribution pages for example) or editing intro/description text? Or is this a 2.0 thing?
thanks!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviMail Subscribe Block?
February 25, 2008, 02:31:35 pm

No those pages are not configurable in 1.9 and 2.0. You can edit the intro description by customizing the template (check docs / forums for how to do this)

if important to you/your org, please contribute a patch to do the needful and/or hire a developer to build the needed functionality

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

jday

  • I post occasionally
  • **
  • Posts: 62
  • Karma: 6
  • CiviCRM version: 4.2
  • CMS version: 7.15
Re: CiviMail Subscribe Block?
February 22, 2009, 04:10:40 pm
I am using this method to put a newsletter subscribe block on the drupal side of my site:
http://<your drupal site>/civicrm/mailing/subscribe?reset=1&gid=2

but when the user hits the 'subscribe' button, they are redirected to a group member search page ".../civicrm/group/search?reset=1..." which displays the message:

Your subscription request has been submitted. Check your inbox shortly for the confirmation email(s).

How can I keep the user on the subscribe page and display the message above the subscribe form rather than redirecting?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: CiviMail Subscribe Block?
February 23, 2009, 02:14:29 pm
We've improved the behavior of this form in 2.2 - user is redirected back to the page they came from by default, and you can add a destination= parameter to the link which loads the form if you want to specify some other destination.

http://issues.civicrm.org/jira/browse/CRM-3467

However, for 2.1 I don't think the behavior you're reporting is expected behavior for an anonymous user. Can you make sure you're testing it that way.
Protect your investment in CiviCRM by  becoming a Member!

jday

  • I post occasionally
  • **
  • Posts: 62
  • Karma: 6
  • CiviCRM version: 4.2
  • CMS version: 7.15
Re: CiviMail Subscribe Block?
February 24, 2009, 12:09:55 pm
ah yes you are right, I was logged in as admin, so switching to a user role displays a confirmation page BUT also a link to "view listings" which gives them access to everyone's email address!!!

It looks like to disable the viewing of listings I would also be disabling access to forms (profile, event and contribution forms) am I wrong here? how can I give access to forms but not listings?

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • CiviMail Subscribe Block?

This forum was archived on 2017-11-26.