Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
the
formatting
  • Loading branch information
detain committed Apr 4, 2019
1 parent ad7948d commit 93697b8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ public static function doMailinglistSubscribe(GenericEvent $event)
/**
* @param \Symfony\Component\EventDispatcher\GenericEvent $event
*/
public static function getSettings(GenericEvent $event)
{
/**
* @var \MyAdmin\Settings $settings
**/
$settings = $event->getSubject();
public static function getSettings(GenericEvent $event)
{
/**
* @var \MyAdmin\Settings $settings
**/
$settings = $event->getSubject();
$settings->add_dropdown_setting(_('Accounts'), _('Sendy'), 'sendy_enable', _('Enable Sendy'), _('Enable/Disable Sendy Mailing on Account Signup'), (defined('SENDY_ENABLE') ? SENDY_ENABLE : '0'), ['0', '1'], ['No', 'Yes']);
$settings->add_text_setting(_('Accounts'), _('Sendy'), 'sendy_api_key', _('API Key'), _('API Key'), (defined('SENDY_API_KEY') ? SENDY_API_KEY : ''));
$settings->add_text_setting(_('Accounts'), _('Sendy'), 'sendy_list_id', _('List ID'), _('List ID'), (defined('SENDY_LIST_ID') ? SENDY_LIST_ID : ''));
Expand Down Expand Up @@ -107,14 +107,14 @@ public static function doEmailSetup($email, $params = false)
'content' => $postdata
]
];
\StatisticClient::tick('Sendy', 'subscribe');
\StatisticClient::tick('Sendy', 'subscribe');
$context = stream_context_create($opts);
$result = trim(file_get_contents(SENDY_APIURL.'/subscribe', false, $context));
if ($result != '1' && $result != 'Already subscribed.') {
\StatisticClient::report('Sendy', 'subscribe', false, 100, $result, STATISTICS_SERVER);
\StatisticClient::report('Sendy', 'subscribe', false, 100, $result, STATISTICS_SERVER);
myadmin_log('accounts', 'info', "Sendy Response: {$result}", __LINE__, __FILE__);
} else {
\StatisticClient::report('Sendy', 'subscribe', true, 0, '', STATISTICS_SERVER);
}
\StatisticClient::report('Sendy', 'subscribe', true, 0, '', STATISTICS_SERVER);
}
}
}

0 comments on commit 93697b8

Please sign in to comment.