Skip to content

Commit eb74b15

Browse files
committed
Merge branch 'develop'
2 parents c90cd3d + 75ef4ee commit eb74b15

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

formidable/config.imba

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ export default {
77

88
default: 'smtp'
99

10+
11+
# --------------------------------------------------------------------------
12+
# Mailer Error Handling
13+
# --------------------------------------------------------------------------
14+
#
15+
# This option controls whether or not Formidable will ignore errors when
16+
# sending email. Typically you should set this value to false so that any
17+
# errors will be shown in the console.
18+
19+
ignore_errors: false
20+
1021
# --------------------------------------------------------------------------
1122
# Mailer Configuration
1223
# --------------------------------------------------------------------------

formidable/config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ export default {
99

1010
default: 'smtp',
1111

12+
/**
13+
* --------------------------------------------------------------------------
14+
* Mailer Error Handling
15+
* --------------------------------------------------------------------------
16+
*
17+
* This option controls whether or not Formidable will ignore errors when
18+
* sending email. Typically you should set this value to false so that any
19+
* errors will be shown in the console.
20+
*/
21+
ignore_errors: false,
22+
1223
/**
1324
* --------------------------------------------------------------------------
1425
* Mailer Configuration

src/Mail.imba

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@ export class Mail
103103
config.onComplete(response) if config.onComplete
104104
)
105105
else
106-
await self.transport!.sendMail(mail)
106+
if settings.config.ignore_errors && settings.config.ignore_errors === true
107+
self.transport!.sendMail(mail).catch(do(reason)
108+
console.warm(reason)
109+
)
110+
else
111+
await self.transport!.sendMail(mail)
107112

108113
def attach attachment\object[]|object = []
109114
if Array.isArray(attachment)

0 commit comments

Comments
 (0)