Answers.Body: <p>Mmm... Unless I'm mistaking your intention, this should be very easy to do with a webform, if you are using Drupal with Civicrm and the Civicrm webform integration module. </p>
  
  <p>As far as I know, if your email asks them to go to your webform by clicking a link that contains the 'contact hash' token, then when they get to the webform it will be prefilled with their details. </p>
  
  <p>In the Civicrm section of the webform config screens you can choose which Civicrm info to include, and also whether to add the user to a Civicrm group when the form is submitted. (You'd need to make your group in Civi before configuring this part of the webform.)</p>
  
  <p>Then the user simply clicks 'submit' and they will be added to your group.</p>
  
  <p>Hope I've got the right end of the stick here and that this is helpful.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-24T23:52:46.690Z
Answers.LastActivityDate: 2018-01-24T23:52:46.690Z
Answers.UserDisplayName: Andyg8
Answers.Body: <p>I think you can do this using CiviCRM Profiles. Ish.</p>
  
  <ol>
  <li><p>Create a profile (Administer » Customise Data and Screens » Profiles)</p></li>
  <li><p>Open the profile's Advanced Settings and look for "Add new contacts to a group" and select the new mailing group you want to invite people into.</p></li>
  <li><p>Save the profile then add any fields you want the user to be able to see/edit.</p></li>
  <li><p>Now you have a form that users can use to add themselves into your database and onto your new list, you just need to provide people with a special link in your email. Read on.</p></li>
  <li><p>In the profiles page, identify the ID of the new profile, which will be a number. I'm going to pretend mine is 123 for this example.</p></li>
  <li><p>Draft a mailing. Add a link with whatever text you want and craft a URL like this (Drupal example, enjoy adjusting for WP/joomla at your leisure):</p>
  
  <pre><code>https://yourdomain.com/civicrm/profile/edit?reset=1&amp;gid=123&amp;id={contact.contact_id}&amp;gid=123&amp;{contact.checksum}
  </code></pre></li>
  <li><p>Send yourself a test mailing and open the link in a not-logged in browser ( e.g. use a "Private Browsing" or "Incogneto" tab. You should see a form and if you submit that form you should be added to your new group.</p></li>
  </ol>
  
  <h2>Yes but I want a one-click solution!</h2>
  
  <p>Yes I didn't miss that, which is why I said this was an "ish" solution. You could achieve this, if really necessary, by including custom javascript on the 
  profile form that automatically submitted the form as soon as the page loads.</p>
  
  <p>This sounds quirky but has other advantages too, well, one, which is that it saves your link from being "clicked" by spam/virus checkers that may scan the email before it lands in the recipients inbox. If it was a 'open this link and something gets changed' then these automated systems would mess it up for you quite a lot. But these automated systems won't execute javascript, so that way you get the functionality without the side effects. I believe this is how (and why) Mailchimp do this on their unsubscribe links.</p>
  
  <p>Q. How to include javascript on a particular profile form? Try <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_buildProfile/" rel="nofollow noreferrer"><code>hook_civicrm_buildProfile</code></a></p>
  
  <p>(EDIT: corrected the magic link above - it was previously taking you to just a view, not an edit form.)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-03-01T11:02:27.847Z
Answers.LastActivityDate: 2019-11-14T11:07:38.693Z
Answers.LastEditDate: 2019-11-14T11:07:38.693Z
Answers.UserDisplayName: artfulrobot
Answers.Body: <p>I would do this with a webform and configuration to select the group automatically on a trigger. To do this with a separate link would require a little amount of coding.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-22T11:36:24.653Z
Answers.LastActivityDate: 2018-01-22T11:36:24.653Z
Answers.UserDisplayName: JohnFF
Answers.Body: <p>I wrote an extension that ALMOST does this - and I started work to support "add to group with a single click from email" in my <a href="https://civicrm.org/extensions/fast-action-links" rel="nofollow noreferrer">Fast Action Links</a> extension.  I never added that feature because it was an unfunded side project.  It would probably take 2-3 hours to complete.  </p>
  
  <p>If you're a coder, you can download the extension and see the commented-out "token" section.  It would need to be finished, plus a call to <code>hook_civicrm_apiWrapper</code> for security purposes.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-22T17:55:41.933Z
Answers.LastActivityDate: 2018-01-22T17:55:41.933Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <p>I think this what you are looking for, but some tweak is required to work properly with CiviCRM 5.x</p>
  
  <p><a href="https://github.com/veda-consulting/webform_gdpr" rel="nofollow noreferrer">https://github.com/veda-consulting/webform_gdpr</a></p>
  
  <p>Use it along with the GDPR extension. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-15T08:28:53.543Z
Answers.LastActivityDate: 2019-11-15T13:33:55.467Z
Answers.LastEditDate: 2019-11-15T13:33:55.467Z
Answers.UserDisplayName: Tapash
Body: <p>I want to send out an email to all customers currently sitting in our ‘newsletter ‘  group asking them to opt in / subscribe to being in new 'Event &amp; training group / Updates &amp; information group...etc. We are getting ready for GDPR / 25th May.</p>
  
  <p>What would be the easiest way to do this? Has anyone got any examples of how they have done this were customers have just clicked on a links and they have then automatically ended up in a group?</p>
  
  <p>Thanks 
  Anna</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-01T11:04:17.160Z
Comments.Text: I've just added an answer, but a bigger question is to maintain an audit trail of this, as required to evidence consent. I'm not asking for an answer here (not what comments are for), but just logging it for anyone else thinking about GDPR!
Comments.UserDisplayName: artfulrobot
Tags: <email><gdpr>
Title: GDPR , opt in webforms
ThreadText: # GDPR , opt in webforms
  
  (Asked by: username_0 on 2018-01-22)
  
  I want to send out an email to all customers currently sitting in our ‘newsletter ‘ group asking them to opt in / subscribe to being in new 'Event & training group / Updates & information group...etc. We are getting ready for GDPR / 25th May.
  
  What would be the easiest way to do this? Has anyone got any examples of how they have done this were customers have just clicked on a links and they have then automatically ended up in a group?
  
  Thanks
  username_0
  
  **Tags:** email, gdpr
  
  > **Comments:**
  > **username_1**: I've just added an answer, but a bigger question is to maintain an audit trail of this, as required to evidence consent. I'm not asking for an answer here (not what comments are for), but just logging it for anyone else thinking about GDPR!  
  
  ---
  
  ## 5 answers
  
  ### Answer by username_2 on 2018-01-24. Score: 2
  
  Mmm... Unless I'm mistaking your intention, this should be very easy to do with a webform, if you are using Drupal with Civicrm and the Civicrm webform integration module.
  
  As far as I know, if your email asks them to go to your webform by clicking a link that contains the 'contact hash' token, then when they get to the webform it will be prefilled with their details.
  
  In the Civicrm section of the webform config screens you can choose which Civicrm info to include, and also whether to add the user to a Civicrm group when the form is submitted. (You'd need to make your group in Civi before configuring this part of the webform.)
  
  Then the user simply clicks 'submit' and they will be added to your group.
  
  Hope I've got the right end of the stick here and that this is helpful.
  
  
  ---
  
  ### Answer by username_1 on 2018-03-01. Score: 1
  
  I think you can do this using CiviCRM Profiles. Ish.
  
  Create a profile (Administer » Customise Data and Screens » Profiles)
  Open the profile's Advanced Settings and look for "Add new contacts to a group" and select the new mailing group you want to invite people into.
  Save the profile then add any fields you want the user to be able to see/edit.
  Now you have a form that users can use to add themselves into your database and onto your new list, you just need to provide people with a special link in your email. Read on.
  In the profiles page, identify the ID of the new profile, which will be a number. I'm going to pretend mine is 123 for this example.
  Draft a mailing. Add a link with whatever text you want and craft a URL like this (Drupal example, enjoy adjusting for WP/joomla at your leisure):
  https://yourdomain.com/civicrm/profile/edit?reset=1&gid=123&id={contact.contact_id}&gid=123&{contact.checksum}
  
  Send yourself a test mailing and open the link in a not-logged in browser ( e.g. use a "Private Browsing" or "Incogneto" tab. You should see a form and if you submit that form you should be added to your new group.
  
  Yes but I want a one-click solution!
  Yes I didn't miss that, which is why I said this was an "ish" solution. You could achieve this, if really necessary, by including custom javascript on the 
  profile form that automatically submitted the form as soon as the page loads.
  This sounds quirky but has other advantages too, well, one, which is that it saves your link from being "clicked" by spam/virus checkers that may scan the email before it lands in the recipients inbox. If it was a 'open this link and something gets changed' then these automated systems would mess it up for you quite a lot. But these automated systems won't execute javascript, so that way you get the functionality without the side effects. I believe this is how (and why) Mailchimp do this on their unsubscribe links.
  Q. How to include javascript on a particular profile form? Try hook_civicrm_buildProfile
  (EDIT: corrected the magic link above - it was previously taking you to just a view, not an edit form.)
  
  
  ---
  
  ### Answer by username_3 on 2018-01-22. Score: 1
  
  I would do this with a webform and configuration to select the group automatically on a trigger. To do this with a separate link would require a little amount of coding.
  
  
  ---
  
  ### Answer by username_4 on 2018-01-22. Score: 1
  
  I wrote an extension that ALMOST does this - and I started work to support "add to group with a single click from email" in my [Fast Action Links](https://civicrm.org/extensions/fast-action-links) extension. I never added that feature because it was an unfunded side project. It would probably take 2-3 hours to complete.
  
  If you're a coder, you can download the extension and see the commented-out "token" section. It would need to be finished, plus a call to `hook_civicrm_apiWrapper` for security purposes.
  
  
  ---
  
  ### Answer by username_5 on 2019-11-15. Score: 0
  
  I think this what you are looking for, but some tweak is required to work properly with CiviCRM 5.x
  
  <https://github.com/veda-consulting/webform_gdpr>
  
  Use it along with the GDPR extension.
  
  
  ---
  
  