-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor swiftmailer to symfony mailer #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Refactor swiftmailer to symfony mailer #10
Conversation
Kira kira ini mau di evaluate kapan yak? |
1 similar comment
Kira kira ini mau di evaluate kapan yak? |
Guys sepertinya ini akan obsolete ketika tidak di implementasikan |
* @return \Illuminate\Auth\Reminders\RemindableInterface | ||
* | ||
* @throws \UnexpectedValueException | ||
*/ | ||
public function getUser(array $credentials) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexzPurewoko ada pertimbangan tertentu kenapa return value-nya jadi nullable dan throw-nya dihapus?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexzPurewoko kenapa perlu dibuat V2
?
@@ -13,7 +13,8 @@ | |||
"illuminate/log": "4.2.*", | |||
"illuminate/support": "4.2.*", | |||
"illuminate/view": "4.2.*", | |||
"swiftmailer/swiftmailer": "~5.1" | |||
"swiftmailer/swiftmailer": "~5.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexzPurewoko switftmailer-nya ngga sekalian dihapus aja?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires illuminate/queue 4.2.* -> satisfiable by illuminate/queue[v4.2.0-BETA1, ..., 4.2.x-dev].
- Root composer.json requires symfony/mailer ^6.4 -> satisfiable by symfony/mailer[v6.4.0-BETA1, ..., 6.4.x-dev].
- illuminate/http[v4.2.0-BETA1, ..., 4.2.x-dev] require symfony/http-kernel 2.5.* -> satisfiable by symfony/http-kernel[v2.5.0-BETA1, ..., 2.5.x-dev].
- illuminate/queue[v4.2.0-BETA1, ..., 4.2.x-dev] require illuminate/http 4.2.* -> satisfiable by illuminate/http[v4.2.0-BETA1, ..., 4.2.x-dev].
- symfony/mailer[v6.4.0-BETA1, ..., 6.4.x-dev] conflict with symfony/http-kernel v2.5.8.
- symfony/mailer[v6.4.0-BETA1, ..., 6.4.x-dev] conflict with symfony/http-kernel v2.5.3.
- symfony/mailer[v6.4.0-BETA1, ..., 6.4.x-dev] conflict with symfony/http-kernel v2.5.0.
- symfony/mailer[v6.4.0-BETA1, ..., 6.4.x-dev] conflict with symfony/http-kernel v2.5.0-BETA1.
- symfony/mailer[v6.4.0-BETA1, ..., 6.4.x-dev] conflict with symfony/http-kernel 2.5.x-dev.
Aku kena ini mas @rizqyhi pas run composer remove...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexzPurewoko kamu kena ini pas apa? Aku coba reproduce gabisa.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coba mas execute composer remove symfony mailer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh sorry mas, masuk ke directory Illuminate/Mail, then execute composer remove swiftmailer/swiftmailer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh tapi gimana kalau ini di PR terpisah aja mas @rizqyhi ? reference dari provider udah di set ke LogTransportV2 sih. jadi pandanganku dah aman
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Soalnya kan ada Mailgun dan Mandrill transport nih, buat jaga - jaga aja di prod. Soalnya kalau dependensi swift mailer di remove, nanti perlu remove dua implementasi transport itu jg
// If the given view is an array with numeric keys, we will just assume that | ||
// both a "pretty" and "plain" view were provided, so we will return this | ||
// array as is, since must should contain both views with numeric keys. | ||
if (is_array($view) && isset($view[0])) | ||
{ | ||
return $view; | ||
return [$view[0], $view[1] ?? null]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexzPurewoko kenapa perlu mengecek masing-masing element? Kalau melihat deskripsi di atas, lebih masuk akal mengembalikan $view
langsung.
elseif (is_string($callback)) | ||
else | ||
{ | ||
return $this->container[$callback]->mail($message); | ||
} | ||
|
||
throw new \InvalidArgumentException("Callback is not valid."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexzPurewoko kenapa exception ini dihapus?
@@ -31,6 +31,7 @@ | |||
"symfony/finder": "~6.4", | |||
"symfony/http-foundation": "~6.4", | |||
"symfony/http-kernel": "~6.4", | |||
"symfony/mailer": "^6.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexzPurewoko swiftmailer di list ini juga perlu dihapus.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oke done
src/Illuminate/Mail/Message.php
Outdated
public function sender(string $address, ?string $name = null): self | ||
{ | ||
$this->swift->setSender($address, $name); | ||
$this->message->sender(new Address($address, $name)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexzPurewoko parameter $name
di constructor Address
ngga nullable, jadi ini perlu diberi pengaman seperti di method from
di atas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Problem Statement
Swiftmailer is no longer maintained and they recommend us to use [Symfony Mailer](https://symfony.com/doc/current/mailer.html).
[The end of Swiftmailer (Symfony Blog)](https://symfony.com/blog/the-end-of-swiftmailer)
Plan & Todos
symfony/mailer
6.0. Versi 9.x laravel dipakai karena lebih dekat implementasinya ke 4.2, menghindari adanya beberapa major change pada versi selanjutnya.