mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 13:24:24 +00:00
start work on newsletter plugin
This commit is contained in:
@@ -7,4 +7,38 @@
|
||||
*
|
||||
*/
|
||||
|
||||
module.exports = ( app, settings ) => {};
|
||||
const path = require( 'path' );
|
||||
const mm = require( '../../../mail/mailSender.js' );
|
||||
const sendMail = new mm();
|
||||
|
||||
module.exports = ( app, settings ) => {
|
||||
app.get( '/admin/mail/compose', ( request, response ) => {
|
||||
if ( request.session.loggedInAdmin ) {
|
||||
response.sendFile( path.join( __dirname + '/html/compose.html' ) );
|
||||
} else {
|
||||
response.status( 403 ).send( 'unauthenticated' );
|
||||
}
|
||||
} );
|
||||
|
||||
app.post( '/admin/mail/send', ( request, response ) => {
|
||||
if ( request.session.loggedInAdmin ) {
|
||||
response.send( 'ok' );
|
||||
sendMail.send( request.body.message, request.body.subject, request.body.mode, request.body.replyTo, request.body.receiver, request.body.lang );
|
||||
} else {
|
||||
response.status( 403 ).send( 'unauthenticated' );
|
||||
}
|
||||
} );
|
||||
|
||||
app.get( '/mail/unsubscribe', ( request, response ) => {
|
||||
response.sendFile( path.join( __dirname + '/html/unsubscribe.html' ) );
|
||||
} );
|
||||
|
||||
app.post( '/mail/unsubscribe/go', ( request, response ) => {
|
||||
if ( request.body.mail == '' ) {
|
||||
response.sendFile( path.join( __dirname + '/html/unsubscribeError.html' ) );
|
||||
} else {
|
||||
sendMail.unsubscribe( request.body.mail );
|
||||
response.sendFile( path.join( __dirname + '/html/unsubscribeComplete.html' ) );
|
||||
}
|
||||
} );
|
||||
};
|
||||
@@ -3,8 +3,8 @@
|
||||
"setupDone":true,
|
||||
"twoFA":"enforce",
|
||||
"twoFAMode":"enhanced",
|
||||
"db":"json",
|
||||
"payments":"payrexx",
|
||||
"db":"mysql",
|
||||
"payments":"stripe",
|
||||
"name":"libreevent",
|
||||
"yourDomain":"http://localhost:8080",
|
||||
"mailSender":"libreevent <no-reply@libreevent.janishutz.com>",
|
||||
|
||||
Reference in New Issue
Block a user