refactoring email notification, closes #8

This commit is contained in:
les
2019-09-06 11:58:11 +02:00
parent 2c24591621
commit beebca7ab9
31 changed files with 195 additions and 149 deletions

View File

@@ -36,11 +36,13 @@ module.exports = (sequelize, DataTypes) => {
event.hasMany(models.comment)
}
//
event.prototype.toAP = function (username, follower) {
const tags = this.tags && '-' + this.tags.map(t => '#' + t.tag).join(' ')
const content = `<b><a href='${config.baseurl}/event/${this.id}'>${this.title}</a></b> @${this.place.name}
${moment.unix(this.start_datetime).format('dddd, D MMMM (HH:mm)')}<br/>
${this.description.length > 200 ? this.description.substr(0, 200) + '...' : this.description} ${tags} <br/>`
return {
id: `${config.baseurl}/federation/m/c_${this.id}`,
type: 'Create',