I've found this in line 37 of simplenews.subscription.inc, inside function simplenews_subscription_manager_form

$form['#redirect'] = ''; //Return to home page after (un)subscribe

How can I change this to send anonymous users to a custom "thank you" page ?

Comments

sutharsan’s picture

Status: Active » Closed (won't fix)

By writing a small module that uses hook_form_alter to set a redirect destination.

clau_bolson’s picture

Thank you, I am new to drupal (but not to php) and yet need to find my way around...

pawel.traczynski’s picture

Clau Bolson: Did you made the custom module?
Did it work?
If yes, can you share?

clau_bolson’s picture

No, changed the module code... know it shouldn't be done... but it was easier this way.

each time it says
$form['#redirect'] = ''; //Return to home page after (un)subscribe

I replaced '' with the desired page, ant it worked.

alex.k’s picture

Version: 6.x-1.0-beta5 » 6.x-1.0-rc6
Status: Closed (won't fix) » Active
StatusFileSize
new80.71 KB
new13.46 KB
new232 bytes

I wrote a small module that adds configuration options to each newsletter, whether to show a message or redirect to a thank-you page upon (un)subscription. Anyone who has this need, give it a try. Just create a directory called "simplenews_thankyou" under sites/all/modules, and place the two files there. Rename .php to .module.

Reopening this issue just to get a piece of feedback... if maintainer wants to, I can re-roll it as a patch to simplenews (preferably), or if not, will publish it as a separate module.

avdp’s picture

hi,
Thanks for the custom module, it works wonderful.

One remark:
At the page admin/settings/simplenews/newsletter it shows the options, after the 'save configurations' button.
These general settings do not override the per-newsletter settings (admin/content/simplenews/types/edit/1).

meatron’s picture

Thanks for the module, it works perfectly. It could be more visible though, I found here only after a longer search.
One to customize the manage subscriptions page and text would be nice too.

alex.k’s picture

It should be published as a separate module, it doesn't look like I can roll it into simplenews.

sutharsan’s picture

Your welcome to supply a HEAD patch for this function. No need for a separate module, pls include it in the main, it is requested regularly.

eme’s picture

Yes indeed : very usefull module !

For those who don't know well Drupal, the simplenews_thankyou.php.txt file should be renamed as simplenews_thankyou.module.

sutharsan’s picture

Version: 6.x-1.0-rc6 » 6.x-2.x-dev
sutharsan’s picture

mmliju’s picture

i have installed simplenews_realname module to the simplenew
i have activated simplenews_thankyou module
after that my simplenews_realname is not working but thankyou is working fine
please help

arne.olafson’s picture

StatusFileSize
new78.77 KB

Here's a zip file of properly named files you can upload to your modules directory. The one issue I'm having with the application of it is that it doesn't seem to work for anonymous users.