This commit is contained in:
2021-06-30 22:27:07 +02:00
parent b2bed61e82
commit fdc36ff64f
81 changed files with 16 additions and 21 deletions

0
.adonisrc.json Normal file → Executable file
View File

0
.dockerignore Normal file → Executable file
View File

0
.editorconfig Normal file → Executable file
View File

0
.env.example Normal file → Executable file
View File

0
.gitignore vendored Normal file → Executable file
View File

0
Dockerfile Normal file → Executable file
View File

0
LICENSE Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
ace Normal file → Executable file
View File

0
ace-manifest.json Normal file → Executable file
View File

0
app/Controllers/Http/AuthController.ts Normal file → Executable file
View File

0
app/Controllers/Http/FileController.ts Normal file → Executable file
View File

6
app/Controllers/Http/FormsController.ts Normal file → Executable file
View File

@@ -1,7 +1,7 @@
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
import FormValidator from "App/Validators/FormValidator";
import Form from "App/Models/Form";
//import FormConfirmation from "App/Mailers/FormConfirmation";
import FormConfirmation from "App/Mailers/FormConfirmation";
export default class FormsController {
@@ -10,10 +10,10 @@ export default class FormsController {
await Form.create(data)
//await new FormConfirmation(data.name, data.email).sendLater()
await new FormConfirmation(data.name, data.email).preview()
//todo send confirmation email + email to me
return response.status(200).send({
status: 200
message: 'Form successfully received !'
})
}

0
app/Controllers/Http/GuestBookController.ts Normal file → Executable file
View File

0
app/Controllers/Http/LocationsController.ts Normal file → Executable file
View File

0
app/Controllers/Http/PostsController.ts Normal file → Executable file
View File

0
app/Controllers/Http/ProfileController.ts Normal file → Executable file
View File

0
app/Controllers/Http/ProjectsController.ts Normal file → Executable file
View File

0
app/Controllers/Http/StatesController.ts Normal file → Executable file
View File

0
app/Controllers/Http/SubscribersController.ts Normal file → Executable file
View File

0
app/Controllers/Http/UsersController.ts Normal file → Executable file
View File

0
app/Exceptions/Handler.ts Normal file → Executable file
View File

13
app/Mailers/FormConfirmation.ts Normal file → Executable file
View File

@@ -1,6 +1,4 @@
import mjml from 'mjml'
import { BaseMailer, MessageContract } from '@ioc:Adonis/Addons/Mail'
import View from "@ioc:Adonis/Core/View";
export default class FormConfirmation extends BaseMailer {
@@ -8,16 +6,19 @@ export default class FormConfirmation extends BaseMailer {
super()
}
public html = mjml(View.render('emails/confirmation_form', {
/*public html = mjml(View.render('emails/confirmation_form', {
name: this.name
})).html
})).html*/
public prepare(message: MessageContract) {
message
.from('no-reply@arthurdanjou.fr')
.replyTo('contact@arthurdanjou.fr')
.to(this.email)
.subject('Confirmation Form')
.html(this.html)
.subject('Thank you for contacting !')
.htmlView('emails/confirmation_form', {
name: this.name,
url: 'https://arthurdanjou.fr'
})
}
}

0
app/Middleware/Auth.ts Normal file → Executable file
View File

0
app/Middleware/SilentAuth.ts Normal file → Executable file
View File

0
app/Models/File.ts Normal file → Executable file
View File

0
app/Models/Form.ts Normal file → Executable file
View File

0
app/Models/GuestBookMessage.ts Normal file → Executable file
View File

0
app/Models/Location.ts Normal file → Executable file
View File

0
app/Models/Post.ts Normal file → Executable file
View File

0
app/Models/Project.ts Normal file → Executable file
View File

0
app/Models/Song.ts Normal file → Executable file
View File

0
app/Models/Subscriber.ts Normal file → Executable file
View File

0
app/Models/User.ts Normal file → Executable file
View File

0
app/Tasks/GetDiscordActivity.ts Normal file → Executable file
View File

0
app/Tasks/UpdateGithubReadme.ts Normal file → Executable file
View File

0
app/Validators/AuthValidator.ts Normal file → Executable file
View File

0
app/Validators/FormValidator.ts Normal file → Executable file
View File

0
app/Validators/guestbook/GuestValidator.ts Normal file → Executable file
View File

0
app/Validators/location/LocationValidator.ts Normal file → Executable file
View File

0
app/Validators/project/ProjectValidator.ts Normal file → Executable file
View File

0
app/Validators/subscriber/SubscriberValidator.ts Normal file → Executable file
View File

0
app/Validators/users/UserStoreValidator.ts Normal file → Executable file
View File

0
app/Validators/users/UserUpdateValidator.ts Normal file → Executable file
View File

0
commands/index.ts Normal file → Executable file
View File

0
config/ally.ts Normal file → Executable file
View File

0
config/app.ts Normal file → Executable file
View File

0
config/auth.ts Normal file → Executable file
View File

0
config/bodyparser.ts Normal file → Executable file
View File

0
config/cors.ts Normal file → Executable file
View File

0
config/database.ts Normal file → Executable file
View File

0
config/hash.ts Normal file → Executable file
View File

0
config/mail.ts Normal file → Executable file
View File

0
config/redis.ts Normal file → Executable file
View File

0
config/session.ts Normal file → Executable file
View File

0
contracts/ally.ts Normal file → Executable file
View File

0
contracts/auth.ts Normal file → Executable file
View File

0
contracts/env.ts Normal file → Executable file
View File

0
contracts/events.ts Normal file → Executable file
View File

0
contracts/hash.ts Normal file → Executable file
View File

0
contracts/mail.ts Normal file → Executable file
View File

0
contracts/redis.ts Normal file → Executable file
View File

0
database/factories/index.ts Normal file → Executable file
View File

0
database/migrations/1603020084373_subscribers.ts Normal file → Executable file
View File

0
database/migrations/1605956543449_files.ts Normal file → Executable file
View File

0
database/migrations/1605956711010_posts.ts Normal file → Executable file
View File

0
database/migrations/1608409476823_locations.ts Normal file → Executable file
View File

0
database/migrations/1608415261417_projects.ts Normal file → Executable file
View File

0
database/migrations/1618661863952_forms.ts Normal file → Executable file
View File

0
database/migrations/1621542488791_golden_messages.ts Normal file → Executable file
View File

0
database/migrations/1625078903131_users.ts Normal file → Executable file
View File

0
database/migrations/1625078908619_api_tokens.ts Normal file → Executable file
View File

0
env.ts Normal file → Executable file
View File

2
package.json Normal file → Executable file
View File

@@ -30,7 +30,7 @@
"@adonisjs/view": "^6.0.3",
"axios": "^0.21.1",
"luxon": "^1.27.0",
"mjml": "^4.10.0",
"mjml": "^4.10.1",
"mysql": "^2.18.1",
"phc-argon2": "^1.1.1",
"proxy-addr": "^2.0.7",

0
providers/AppProvider.ts Normal file → Executable file
View File

14
resources/views/emails/confirmation_form.edge Normal file → Executable file
View File

@@ -1,10 +1,4 @@
<mjml>
<mj-body>
<mj-section>
<mj-column>
<mj-divider border-color="#F45E43"></mj-divider>
<mj-text font-size="20px" color="#F45E43" font-family="helvetica">Hello World</mj-text>
</mj-column>
</mj-section>
</mj-body>
</mjml>
<h1> Welcome {{ name }} </h1>
<p>
<a href="{{ url }}">Click here</a> to verify your email address.
</p>

0
server.ts Normal file → Executable file
View File

0
start/kernel.ts Normal file → Executable file
View File

0
start/routes.ts Normal file → Executable file
View File

0
tsconfig.json Normal file → Executable file
View File

2
yarn.lock Normal file → Executable file
View File

@@ -3272,7 +3272,7 @@ mjml-wrapper@4.10.1:
mjml-core "4.10.1"
mjml-section "4.10.1"
mjml@^4.10.0:
mjml@^4.10.1:
version "4.10.1"
resolved "https://registry.yarnpkg.com/mjml/-/mjml-4.10.1.tgz#8f5d06815bee01ef033553c73589451704a63e8a"
integrity sha512-cD6F20yIMOUT9xaAVWLfk0DnhQSq6VkpD+LCf/RUWrxsxxkwPJtJfKfrP5TMeuWcmDFS9hfOBS3Jz+NmGh03jQ==