Skip to content

Commit b3d4c0a

Browse files
committed
IntersRegister: update mail to markdown format
1 parent 7f22d93 commit b3d4c0a

File tree

4 files changed

+82
-95
lines changed

4 files changed

+82
-95
lines changed

app/Listeners/Invites/MailInvite.php

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,33 @@
33
namespace App\Listeners\Invites;
44

55
use App\Mail\InterestRegistered;
6+
use HMS\Repositories\MetaRepository;
7+
use HMS\Repositories\RoleRepository;
68
use Illuminate\Contracts\Queue\ShouldQueue;
79
use App\Events\MembershipInterestRegistered;
810

911
class MailInvite implements ShouldQueue
1012
{
13+
/**
14+
* @var MetaRepository
15+
*/
16+
protected $metaRepository;
17+
18+
/**
19+
* @var RoleRepository
20+
*/
21+
protected $roleRepository;
22+
1123
/**
1224
* Create the event listener.
1325
*
1426
* @return void
1527
*/
16-
public function __construct()
28+
public function __construct(MetaRepository $metaRepository, RoleRepository $roleRepository)
1729
{
18-
//
30+
31+
$this->metaRepository = $metaRepository;
32+
$this->roleRepository = $roleRepository;
1933
}
2034

2135
/**
@@ -27,6 +41,6 @@ public function __construct()
2741
public function handle(MembershipInterestRegistered $event)
2842
{
2943
\Mail::to($event->invite->getEmail())
30-
->queue(new InterestRegistered($event->invite));
44+
->queue(new InterestRegistered($event->invite, $this->metaRepository, $this->roleRepository));
3145
}
3246
}

app/Mail/InterestRegistered.php

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,56 @@
22

33
namespace App\Mail;
44

5+
use HMS\Entities\Role;
56
use HMS\Entities\Invite;
67
use Illuminate\Bus\Queueable;
78
use Illuminate\Mail\Mailable;
9+
use HMS\Repositories\MetaRepository;
10+
use HMS\Repositories\RoleRepository;
811
use Illuminate\Queue\SerializesModels;
12+
use Illuminate\Contracts\Queue\ShouldQueue;
913

10-
class InterestRegistered extends Mailable
14+
class InterestRegistered extends Mailable implements ShouldQueue
1115
{
1216
use Queueable, SerializesModels;
1317

1418
/**
15-
* @var Invite
19+
* @var string
1620
*/
17-
protected $invite;
21+
public $token;
22+
23+
/**
24+
* @var string
25+
*/
26+
public $membershipEmail;
27+
28+
/**
29+
* @var string
30+
*/
31+
public $trusteesEmail;
32+
33+
/**
34+
* @var string
35+
*/
36+
public $groupLink;
37+
38+
/**
39+
* @var string
40+
*/
41+
public $rulesHTML;
1842

1943
/**
2044
* Create a new message instance.
2145
*
2246
* @param Invite $invite
2347
*/
24-
public function __construct(Invite $invite)
48+
public function __construct(Invite $invite, MetaRepository $metaRepository, RoleRepository $roleRepository)
2549
{
26-
//
27-
$this->invite = $invite;
50+
$this->token = $invite->getInviteToken();
51+
$this->membershipEmail = $roleRepository->findByName(Role::TEAM_MEMBERSHIP)->getEmail();
52+
$this->trusteesEmail = $roleRepository->findByName(Role::TEAM_TRUSTEES)->getEmail();
53+
$this->groupLink = $metaRepository->get('link_Google Group');
54+
$this->rulesLink = $metaRepository->get('link_Hackspace Rules');
2855
}
2956

3057
/**
@@ -35,14 +62,6 @@ public function __construct(Invite $invite)
3562
public function build()
3663
{
3764
return $this->subject('Nottingham Hackspace: Interest registered')
38-
->view('emails.interestregistered')
39-
->text('emails.text.interestregistered-plain')
40-
->with([
41-
'token' => $this->invite->getInviteToken(),
42-
'membershipEmail' => 'membership@nottinghack.org.uk',
43-
'trusteesEmail' => 'trustees@notinghack.org.uk',
44-
'groupLink' => 'https://groups.google.com/group/nottinghack?hl=en',
45-
'rulesHTML' => 'http://rules.nottinghack.org.uk',
46-
]);
65+
->markdown('emails.interestregistered');
4766
}
4867
}
Lines changed: 31 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,31 @@
1-
<html>
2-
<body>
3-
<p>
4-
Hello!
5-
</p>
6-
7-
<p>
8-
Thank you for registering your interest in Nottingham Hackspace.
9-
</p>
10-
11-
<p>
12-
If you'd like to become a Nottingham Hackspace member, the first step is is to <a href="{{ url('register', $token)}}">create an HMS account</a>. Also, please add "{{ $membershipEmail }}" and "{{ $trusteesEmail }}" to your address book to reduce the chances of hackspace email going into your spam.
13-
</p>
14-
15-
<p>
16-
After creating login details, you'll be asked to fill in some more information about yourself, namely your address and a contact phone number . Don't worry, we won't share this information with anyone, unless legally obliged to do so.
17-
</p>
18-
19-
<p>
20-
Once you've filled in your details, one of our member admins will be notified. They'll give your information a quick check, and if all is well they'll move your membership on to the next stage. This is the part where you get the Nottingham Hackspace bank details, as well as a unique payment reference for your account (please use this reference if possible; it makes it easier to correlate your membership payments to you as a member). Use these details to set up a standing order for your membership fee. Membership is pay-what-you-like on a monthly basis, and you can always change the amount you're paying if you find yourself using the space more or less than you first thought.
21-
</p>
22-
23-
<p>
24-
When the standing order is set-up, once your payment shows up in our bank account. Even if the money leaves your account, payments are not instant between all banks and records don't update immediately, so it may take 3 to 4 days before it's visible in the hackspace account. When it does show, you'll be contacted directly by one of the member admins to arrange first-access; this is where you're given the door codes and your RFID card to get in to the space. Once that's done, you are free to visit at any time, twenty four hours a day.
25-
</p>
26-
27-
<p>
28-
A few important details: Nottingham Hackspace is incorporated as a non-profit company, registration number 07766826. Everyone who works on stuff for the hackspace is a volunteer; the hackspace has no staff, just members. So far, it has also been entirely funded and is self-sustaining through members contributions rather than grants.
29-
</p>
30-
31-
<p>
32-
Here's the URL for the public google group:<br>
33-
<a href="{{ $groupLink }}">{{ $groupLink }}</a>
34-
</p>
35-
36-
<p>
37-
Here are the hackspace rules:<br>
38-
<a href="{{ $rulesHTML }}">{{ $rulesHTML }}</a>
39-
</p>
40-
41-
<p>
42-
If you have any questions, just email.
43-
</p>
44-
45-
<p>
46-
Thanks,<br>
47-
Nottinghack Member Admin Team
48-
</p>
49-
</body>
50-
</html>
1+
@component('mail::message')
2+
# Hello,
3+
4+
Thank you for registering your interest in Nottingham Hackspace.
5+
6+
If you'd like to become a Nottingham Hackspace member, the first step is is to:-
7+
@component('mail::button', ['url' => route('register', $token)])
8+
Create an HMS account
9+
@endcomponent
10+
11+
Also, please add "{{ $membershipEmail }}" and "{{ $trusteesEmail }}" to your address book to reduce the chances of hackspace email going into your spam.
12+
13+
After creating login details, you'll be asked to fill in some more information about yourself, namely your address and a contact phone number . Don't worry, we won't share this information with anyone, unless legally obliged to do so.
14+
15+
Once you've filled in your details, one of our member admins will be notified. They'll give your information a quick check, and if all is well they'll move your membership on to the next stage. This is the part where you get the Nottingham Hackspace bank details, as well as a unique payment reference for your account (please use this reference if possible; it makes it easier to correlate your membership payments to you as a member). Use these details to set up a standing order for your membership fee. Membership is pay-what-you-like on a monthly basis, and you can always change the amount you're paying if you find yourself using the space more or less than you first thought.
16+
17+
When the standing order is set-up, once your payment shows up in our bank account. Even if the money leaves your account, payments are not instant between all banks and records don't update immediately, so it may take 3 to 4 days before it's visible in the hackspace account. When it does show, you'll be contacted directly by one of the member admins to arrange first-access; this is where you're given the door codes and your RFID card to get in to the space. Once that's done, you are free to visit at any time, twenty four hours a day.
18+
19+
A few important details: Nottingham Hackspace is incorporated as a non-profit company, registration number 07766826. Everyone who works on stuff for the hackspace is a volunteer; the hackspace has no staff, just members. So far, it has also been entirely funded and is self-sustaining through members contributions rather than grants.
20+
21+
Here's the URL for the public google group:<br />
22+
{{ $groupLink }}
23+
24+
Here are the hackspace rules:<br />
25+
{{ $rulesLink }}
26+
27+
If you have any questions, just email.
28+
29+
Thanks,<br />
30+
Nottinghack Membership Team
31+
@endcomponent

resources/views/emails/text/interestregistered-plain.blade.php

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)