mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-30 17:01:25 +00:00
remove unused functions
This commit is contained in:
parent
4c92145257
commit
318cc557f7
1 changed files with 0 additions and 39 deletions
39
lib/thirdparty/Mailgun.class.php
vendored
39
lib/thirdparty/Mailgun.class.php
vendored
|
@ -9,29 +9,6 @@ class Mailgun
|
||||||
|
|
||||||
const LIST_GENERAL = 'lbryians@lbry.io';
|
const LIST_GENERAL = 'lbryians@lbry.io';
|
||||||
|
|
||||||
public static function unsubscribeFromMailingList($listAddress, $email)
|
|
||||||
{
|
|
||||||
list($status, $headers, $body) = static::put('/lists/' . $listAddress . '/members/' . $email, [
|
|
||||||
'subscribed' => 'no',
|
|
||||||
]);
|
|
||||||
|
|
||||||
if ($status == 200)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$data = json_decode($body, true);
|
|
||||||
$message = $data['error'] ?? $data['message'] ?? false;
|
|
||||||
|
|
||||||
if (strpos($message, 'Member '.$email) === 0 && strrpos($message, ' not found') === (strlen($message) - strlen(' not found')))
|
|
||||||
{
|
|
||||||
// message says "Member $email ... not found", so email is not on list. that's the same as unsubscribing, right?
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function sendDmcaReport($data)
|
public static function sendDmcaReport($data)
|
||||||
{
|
{
|
||||||
list($status, $headers, $body) = static::post('/' . static::MAIL_DOMAIN . '/messages', [
|
list($status, $headers, $body) = static::post('/' . static::MAIL_DOMAIN . '/messages', [
|
||||||
|
@ -78,22 +55,6 @@ class Mailgun
|
||||||
return $status == 200;
|
return $status == 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function addToMailingList($listAddress, $email)
|
|
||||||
{
|
|
||||||
list($status, $headers, $body) = static::post('/lists/' . $listAddress . '/members', [
|
|
||||||
'address' => $email,
|
|
||||||
// 'subscribed' => 'yes',
|
|
||||||
// 'upsert' => 'no', //https://documentation.mailgun.com/api-mailinglists.html#mailing-lists
|
|
||||||
]);
|
|
||||||
|
|
||||||
if ($status != 200)
|
|
||||||
{
|
|
||||||
return json_decode($body, true)['message'];
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static function getConfirmHash($email, $timestamp = null, $nonce = null)
|
protected static function getConfirmHash($email, $timestamp = null, $nonce = null)
|
||||||
{
|
{
|
||||||
$timestamp = $timestamp !== null ? $timestamp : time();
|
$timestamp = $timestamp !== null ? $timestamp : time();
|
||||||
|
|
Loading…
Add table
Reference in a new issue