Add Netcore Email adapter - #145
Conversation
|
Thanks for contributing! This repository is a read-only mirror; development for this library happens in |
Greptile SummaryAdds a Netcore email provider integration.
Confidence Score: 1/5This PR is not safe to merge because the new adapter cannot successfully construct a normal email request and also misrepresents recipients and plain-text content. Every send invokes a nonexistent Email accessor; after that is corrected, recipient records are still converted to "Array", while default plain-text messages are labeled as AMP. Files Needing Attention: src/Utopia/Messaging/Adapter/Email/Netcore.php Important Files Changed
Prompt To Fix All With AIFix the following 3 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 3
src/Utopia/Messaging/Adapter/Email/Netcore.php:46
**Undefined sender accessor breaks sends**
When any email is sent through this adapter, `process()` calls `Email::getFrom()`, but the message exposes only `getFromName()` and `getFromEmail()`, causing an undefined-method error before the HTTP request is issued.
### Issue 2 of 3
src/Utopia/Messaging/Adapter/Email/Netcore.php:45
**Recipient records stringify as Array**
When a message has recipients, `getTo()` returns nested recipient records that are passed directly to `implode()`, producing `Array` instead of email addresses in the provider payload and delivery results, which causes request rejection and unusable response data.
### Issue 3 of 3
src/Utopia/Messaging/Adapter/Email/Netcore.php:49
**Plain text is mislabeled as AMP**
When an email uses the default `html=false` setting, this branch labels its plain-text body as `amp` rather than text, causing ordinary messages to be rejected by the provider or rendered incorrectly.
Reviews (1): Last reviewed commit: "feat: add Netcore Email adapter" | Re-trigger Greptile |
| ], | ||
| body: [ | ||
| 'to' => \implode(',', $message->getTo()), | ||
| 'from' => $message->getFrom(), |
There was a problem hiding this comment.
Undefined sender accessor breaks sends
When any email is sent through this adapter, process() calls Email::getFrom(), but the message exposes only getFromName() and getFromEmail(), causing an undefined-method error before the HTTP request is issued.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/Utopia/Messaging/Adapter/Email/Netcore.php
Line: 46
Comment:
**Undefined sender accessor breaks sends**
When any email is sent through this adapter, `process()` calls `Email::getFrom()`, but the message exposes only `getFromName()` and `getFromEmail()`, causing an undefined-method error before the HTTP request is issued.
How can I resolve this? If you propose a fix, please make it concise.| 'Content-Type: application/json', | ||
| ], | ||
| body: [ | ||
| 'to' => \implode(',', $message->getTo()), |
There was a problem hiding this comment.
Recipient records stringify as Array
When a message has recipients, getTo() returns nested recipient records that are passed directly to implode(), producing Array instead of email addresses in the provider payload and delivery results, which causes request rejection and unusable response data.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/Utopia/Messaging/Adapter/Email/Netcore.php
Line: 45
Comment:
**Recipient records stringify as Array**
When a message has recipients, `getTo()` returns nested recipient records that are passed directly to `implode()`, producing `Array` instead of email addresses in the provider payload and delivery results, which causes request rejection and unusable response data.
How can I resolve this? If you propose a fix, please make it concise.| 'from' => $message->getFrom(), | ||
| 'subject' => $message->getSubject(), | ||
| 'content' => [ | ||
| 'type' => $message->isHtml() ? 'html' : 'amp', |
There was a problem hiding this comment.
Plain text is mislabeled as AMP
When an email uses the default html=false setting, this branch labels its plain-text body as amp rather than text, causing ordinary messages to be rejected by the provider or rendered incorrectly.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/Utopia/Messaging/Adapter/Email/Netcore.php
Line: 49
Comment:
**Plain text is mislabeled as AMP**
When an email uses the default `html=false` setting, this branch labels its plain-text body as `amp` rather than text, causing ordinary messages to be rejected by the provider or rendered incorrectly.
How can I resolve this? If you propose a fix, please make it concise.
Rebased on latest main with code adaptation.
Adapted from original PR #53 (by codingmickey):