Make contact messages send with priority

This commit is contained in:
Garrett Mills 2022-05-11 22:54:02 -05:00
parent 14dc9c2447
commit 2fede56806
2 changed files with 6 additions and 10 deletions

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SwUserDefinedSpecifications">
<option name="specTypeByUrl">
<map />
</option>
</component>
</project>

View File

@ -10,7 +10,7 @@ import {
file, file,
Application, Application,
make, make,
Valid, Valid, Logging,
} from '@extollo/lib' } from '@extollo/lib'
import {WorkItem} from '../../models/WorkItem.model' import {WorkItem} from '../../models/WorkItem.model'
import {FeedPost} from '../../models/FeedPost.model' import {FeedPost} from '../../models/FeedPost.model'
@ -32,6 +32,9 @@ export class Home extends Controller {
@Inject() @Inject()
protected readonly gotify!: Gotify protected readonly gotify!: Gotify
@Inject()
protected readonly logging!: Logging
public async welcome(feedPosts: Collection<FeedPost>) { public async welcome(feedPosts: Collection<FeedPost>) {
const workItems = await this.getWorkItems() const workItems = await this.getWorkItems()
@ -118,13 +121,14 @@ export class Home extends Controller {
this.gotify.send({ this.gotify.send({
app: this.config.get('gotify.app'), app: this.config.get('gotify.app'),
title: `Contact form submission from ${data.name}`, title: `Contact form submission from ${data.name}`,
priority: 5,
message: [ message: [
`From: ${data.name}`, `From: ${data.name}`,
`E-mail: ${data.email}`, `E-mail: ${data.email}`,
'Message:', 'Message:',
data.message, data.message,
].join('\n'), ].join('\n'),
}) }).then(x => this.logging.debug(x))
return view('message', { return view('message', {
title: 'Message Sent', title: 'Message Sent',