Pretty print SQL

This commit is contained in:
Alex Cabal 2022-12-24 15:44:42 -06:00
parent 31a8bc2d6c
commit 26a24cdbe2
17 changed files with 316 additions and 82 deletions

View file

@ -36,7 +36,12 @@ try{
// Received when a user marks an email as spam
$log->Write('Event type: spam complaint.');
Db::Query('DELETE ns.* from NewsletterSubscriptions ns inner join Users u using(UserId) where u.Email = ?', [$post->Email]);
Db::Query('
DELETE ns.*
from NewsletterSubscriptions ns
inner join Users u using(UserId)
where u.Email = ?
', [$post->Email]);
}
elseif($post->RecordType == 'SubscriptionChange' && $post->SuppressSending){
// Received when a user clicks Postmark's "Unsubscribe" link in a newsletter email
@ -45,7 +50,12 @@ try{
$email = $post->Recipient;
// Remove the email from our newsletter list
Db::Query('DELETE ns.* from NewsletterSubscriptions ns inner join Users u using(UserId) where u.Email = ?', [$email]);
Db::Query('
DELETE ns.*
from NewsletterSubscriptions ns
inner join Users u using(UserId)
where u.Email = ?
', [$email]);
// Remove the suppression from Postmark, since we deleted it from our own list we will never email them again anyway
$handle = curl_init();

View file

@ -37,7 +37,12 @@ try{
if(sizeof($matches) == 2){
$transactionId = $matches[1];
Db::Query('INSERT into PendingPayments (Created, ChannelId, TransactionId) values (utc_timestamp(), ?, ?);', [PAYMENT_CHANNEL_FA, $transactionId]);
Db::Query('
INSERT into PendingPayments (Created, ChannelId, TransactionId)
values (utc_timestamp(),
?,
?)
', [PAYMENT_CHANNEL_FA, $transactionId]);
$log->Write('Donation ID: ' . $transactionId);
}