Skip to content

Commit

Permalink
Remove variables (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterOcansey authored Aug 28, 2024
1 parent 5a6f99a commit dd46507
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 15 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ class TestEmail extends Mailable
// Additional options for MailerSend API features
->mailersend(
template_id: null,
variables: [
new Variable($to, ['name' => 'Your Name'])
],
tags: ['tag'],
personalization: [
new Personalization($to, [
Expand Down Expand Up @@ -175,9 +172,6 @@ class TestEmail extends Mailable
// Additional options for MailerSend API features
$this->mailersend(
template_id: null,
variables: [
new Variable($to, ['name' => 'Your Name'])
],
tags: ['tag'],
personalization: [
new Personalization($to, [
Expand Down
3 changes: 0 additions & 3 deletions src/MailerSendTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ trait MailerSendTrait
{
public function mailersend(
string $template_id = null,
array $variables = [],
array $tags = [],
array $personalization = [],
?bool $precedenceBulkHeader = null,
Expand All @@ -21,7 +20,6 @@ public function mailersend(
if ($this instanceof Mailable && $this->driver() === 'mailersend') {
$this->withSymfonyMessage(function (Email $message) use (
$tags,
$variables,
$template_id,
$personalization,
$sendAt,
Expand All @@ -30,7 +28,6 @@ public function mailersend(
$mailersendData = [];

Arr::set($mailersendData, MailerSendTransport::MAILERSEND_DATA_TEMPLATE_ID, $template_id);
Arr::set($mailersendData, MailerSendTransport::MAILERSEND_DATA_VARIABLES, $variables);
Arr::set($mailersendData, MailerSendTransport::MAILERSEND_DATA_TAGS, $tags);
Arr::set($mailersendData, MailerSendTransport::MAILERSEND_DATA_PERSONALIZATION, $personalization);
Arr::set($mailersendData, MailerSendTransport::MAILERSEND_DATA_PRECENDECE_BULK_HEADER, $precedenceBulkHeader);
Expand Down
4 changes: 0 additions & 4 deletions src/MailerSendTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class MailerSendTransport implements TransportInterface
public const MAILERSEND_DATA_SUBTYPE = 'mailersend-data';

public const MAILERSEND_DATA_TEMPLATE_ID = 'template_id';
public const MAILERSEND_DATA_VARIABLES = 'variables';
public const MAILERSEND_DATA_TAGS = 'tags';
public const MAILERSEND_DATA_PERSONALIZATION = 'personalization';
public const MAILERSEND_DATA_PRECENDECE_BULK_HEADER = 'precedence_bulk_header';
Expand Down Expand Up @@ -62,7 +61,6 @@ public function send(RawMessage $message, Envelope $envelope = null): ?SentMessa

[
'template_id' => $template_id,
'variables' => $variables,
'tags' => $tags,
'personalization' => $personalization,
'precedence_bulk_header' => $precedenceBulkHeader,
Expand All @@ -81,7 +79,6 @@ public function send(RawMessage $message, Envelope $envelope = null): ?SentMessa
->setHtml($html)
->setText($text)
->setTemplateId($template_id)
->setVariables($variables)
->setPersonalization($personalization)
->setAttachments($attachments)
->setTags($tags)
Expand Down Expand Up @@ -176,7 +173,6 @@ protected function getAdditionalData(RawMessage $message): array
{
$defaultValues = [
'template_id' => null,
'variables' => [],
'personalization' => [],
'tags' => [],
'precedence_bulk_header' => null,
Expand Down
2 changes: 0 additions & 2 deletions tests/MailerSendTransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ public function test_get_additional_data(): void

self::assertEquals('id', Arr::get($getAdditionalData,
'template_id'));
self::assertEquals([], Arr::get($getAdditionalData,
'variables'));
self::assertEquals([], Arr::get($getAdditionalData,
'tags'));
self::assertEquals([], Arr::get($getAdditionalData,
Expand Down

0 comments on commit dd46507

Please sign in to comment.