File tree 3 files changed +14
-1
lines changed
3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " medusa-plugin-sendgrid-typescript" ,
3
- "version" : " 2.2.1 " ,
3
+ "version" : " 2.2.2 " ,
4
4
"description" : " SendGrid transactional emails typescript" ,
5
5
"repository" : {
6
6
"type" : " git" ,
Original file line number Diff line number Diff line change @@ -297,6 +297,17 @@ export class SendGridService extends AbstractNotificationService {
297
297
attachmentGenerator
298
298
)
299
299
300
+ const toBcc = ( ) => {
301
+ if ( this . options_ . orderPlacedBcc && event === "order.placed" ) {
302
+
303
+ if ( this . options_ ?. noSendCountries && this ?. options_ ?. noSendCountries . includes ( data . order ?. shipping_address ?. country_code ) ) {
304
+ return undefined
305
+ }
306
+ return this . options_ . orderPlacedBcc
307
+ }
308
+ return undefined
309
+ }
310
+
300
311
const sendOptions : SendGrid . MailDataRequired = {
301
312
templateId : templateId ,
302
313
from : this . options_ . from ,
Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ export interface PluginOptions {
35
35
templates : Templates
36
36
/** BCC email address to send to when an order is placed. */
37
37
orderPlacedBcc ?: EmailData | EmailData [ ]
38
+ /** BCC email address to send to when an order is canceled. */
39
+ noSendCountries ?: string [ ]
38
40
/** locale as key example de-DE */
39
41
localization : {
40
42
[ key : string ] : Templates
You can’t perform that action at this time.
0 commit comments