id: 70
name: GoodNewsRequestLinks
description: 'Upon request - sends a subscriber an email with secure links to update or cancel his subscription.'
category: GoodNews
properties: 'a:14:{s:21:"unsubscribeResourceId";a:7:{s:4:"name";s:21:"unsubscribeResourceId";s:4:"desc";s:52:"prop_goodnewsrequestlinks.unsubscriberesourceid_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:19:"goodnews:properties";s:4:"area";s:0:"";}s:17:"profileResourceId";a:7:{s:4:"name";s:17:"profileResourceId";s:4:"desc";s:48:"prop_goodnewsrequestlinks.profileresourceid_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:19:"goodnews:properties";s:4:"area";s:0:"";}s:19:"submittedResourceId";a:7:{s:4:"name";s:19:"submittedResourceId";s:4:"desc";s:50:"prop_goodnewsrequestlinks.submittedresourceid_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:19:"goodnews:properties";s:4:"area";s:0:"";}s:24:"requestLinksEmailSubject";a:7:{s:4:"name";s:24:"requestLinksEmailSubject";s:4:"desc";s:55:"prop_goodnewsrequestlinks.requestlinksemailsubject_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:19:"goodnews:properties";s:4:"area";s:0:"";}s:20:"requestLinksEmailTpl";a:7:{s:4:"name";s:20:"requestLinksEmailTpl";s:4:"desc";s:51:"prop_goodnewsrequestlinks.requestlinksemailtpl_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:35:"sample.GoodNewsRequestLinksEmailTpl";s:7:"lexicon";s:19:"goodnews:properties";s:4:"area";s:0:"";}s:23:"requestLinksEmailTplAlt";a:7:{s:4:"name";s:23:"requestLinksEmailTplAlt";s:4:"desc";s:54:"prop_goodnewsrequestlinks.requestlinksemailtplalt_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:19:"goodnews:properties";s:4:"area";s:0:"";}s:24:"requestLinksEmailTplType";a:7:{s:4:"name";s:24:"requestLinksEmailTplType";s:4:"desc";s:55:"prop_goodnewsrequestlinks.requestlinksemailtpltype_desc";s:4:"type";s:4:"list";s:7:"options";a:4:{i:0;a:2:{s:5:"value";s:8:"modChunk";s:4:"text";s:18:"opt_goodnews.chunk";}i:1;a:2:{s:5:"value";s:4:"file";s:4:"text";s:17:"opt_goodnews.file";}i:2;a:2:{s:5:"value";s:6:"inline";s:4:"text";s:19:"opt_goodnews.inline";}i:3;a:2:{s:5:"value";s:8:"embedded";s:4:"text";s:21:"opt_goodnews.embedded";}}s:5:"value";s:8:"modChunk";s:7:"lexicon";s:19:"goodnews:properties";s:4:"area";s:0:"";}s:6:"errTpl";a:7:{s:4:"name";s:6:"errTpl";s:4:"desc";s:37:"prop_goodnewsrequestlinks.errtpl_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:37:"[[+error]]";s:7:"lexicon";s:19:"goodnews:properties";s:4:"area";s:0:"";}s:10:"emailField";a:7:{s:4:"name";s:10:"emailField";s:4:"desc";s:41:"prop_goodnewsrequestlinks.emailfield_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:5:"email";s:7:"lexicon";s:19:"goodnews:properties";s:4:"area";s:0:"";}s:20:"sendUnauthorizedPage";a:7:{s:4:"name";s:20:"sendUnauthorizedPage";s:4:"desc";s:51:"prop_goodnewsrequestlinks.sendunauthorizedpage_desc";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:0;s:7:"lexicon";s:19:"goodnews:properties";s:4:"area";s:0:"";}s:9:"submitVar";a:7:{s:4:"name";s:9:"submitVar";s:4:"desc";s:40:"prop_goodnewsrequestlinks.submitvar_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:25:"goodnews-requestlinks-btn";s:7:"lexicon";s:19:"goodnews:properties";s:4:"area";s:0:"";}s:10:"successMsg";a:7:{s:4:"name";s:10:"successMsg";s:4:"desc";s:41:"prop_goodnewsrequestlinks.successmsg_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:19:"goodnews:properties";s:4:"area";s:0:"";}s:8:"validate";a:7:{s:4:"name";s:8:"validate";s:4:"desc";s:39:"prop_goodnewsrequestlinks.validate_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:19:"goodnews:properties";s:4:"area";s:0:"";}s:17:"placeholderPrefix";a:7:{s:4:"name";s:17:"placeholderPrefix";s:4:"desc";s:48:"prop_goodnewsrequestlinks.placeholderprefix_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:19:"goodnews:properties";s:4:"area";s:0:"";}}'
-----
/**
* GoodNews
*
* Copyright 2012 by bitego
*
* GoodNews is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* GoodNews is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this software; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* Snippet which upon request - sends a subscriber an email with secure links to update or cancel his subscription.
*
* @var modX $modx
* @var GoodNewsSubscription $goodnewssubscription
* @var array $scriptProperties
*
* @property string $unsubscribeResourceId The ID of the resource for one-click unsubscription. (default: '')
* @property string $profileResourceId The ID of the resource for editing the mailing profile. (default: '')
* @property string $submittedResourceId If set, will redirect to the specified resource after the user submits the request links form. (default: '')
* @property string $requestLinksEmailSubject The subject of the request links email. (default: a lexicon string)
* @property string $requestLinksEmailTpl The template for the request links email. (default: sample.GoodNewsRequestLinksEmailTpl)
* @property string $requestLinksEmailTplAlt If set, will use this template instead of $requestLinksEmailTpl (e.g. for plaintext mails). (default: '')
* @property string $requestLinksEmailTplType The type of tpl provided for the request links email. (default: modChunk)
* @property string $errTpl Chunk for error output. (default: [[+error]])
* @property string $emailField The name of the field to use for the User's email address. (default: email)
* @property boolean $sendUnauthorizedPage Whether or not to redirect a subscriber to the unauthorized page if not verified (default: 0 = false)
* @property string $submitVar The name of the form submit button that triggers the submission. (default: goodnews-requestlinks-btn)
* @property string $successMsg If page redirects to itself, this message will be set to a placeholder.
* @property string $validate A comma-separated list of fields to validate. (default: '')
* @property string $placeholderPrefix The prefix to use for all placeholders set by this snippet. (default: '')
* @package goodnews
*/
require_once $modx->getOption('goodnews.core_path', null, $modx->getOption('core_path').'components/goodnews/').'model/goodnews/goodnewssubscription.class.php';
$goodnewssubscription = new GoodNewsSubscription($modx, $scriptProperties);
$controller = $goodnewssubscription->loadController('RequestLinks');
$output = $controller->run($scriptProperties);
return $output;