File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
apps/meteor/app/livechat/server/lib Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -65,10 +65,6 @@ export async function sendOfflineMessage(data: OfflineMessageData) {
6565 }
6666 }
6767
68- // TODO Block offline form if Livechat_offline_email is undefined
69- // (it does not make sense to have an offline form that does nothing)
70- // `this.sendEmail` will throw an error if the email is invalid
71- // thus this breaks livechat, since the "to" email is invalid, and that returns an [invalid email] error to the livechat client
7268 let emailTo = settings . get < string > ( 'Livechat_offline_email' ) ;
7369 if ( department && department !== '' ) {
7470 const dep = await LivechatDepartment . findOneByIdOrName ( department , { projection : { email : 1 } } ) ;
@@ -77,6 +73,10 @@ export async function sendOfflineMessage(data: OfflineMessageData) {
7773 }
7874 }
7975
76+ if ( ! emailTo ) {
77+ throw new Error ( 'error-no-email-configured-to-receive-offline-messages' ) ;
78+ }
79+
8080 const fromText = `${ name } - ${ email } <${ from } >` ;
8181 const replyTo = `${ name } <${ email } >` ;
8282 const subject = `Livechat offline message from ${ name } : ${ `${ emailMessage } ` . substring ( 0 , 20 ) } ` ;
You can’t perform that action at this time.
0 commit comments