Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub create_user {
- my ($self, $options) = @_;
- $options ||= {};
- my $config = BoyosPlace->config;
- my $email = BoyosPlace::Email->new(
- to => $options->{email},
- from => $config->{email}{from},
- subject => "Boyosplace.com Registration Confirmation",
- data => "Thank you for signing up!",
- );
- my $create = sub {
- my $user = $self->create(
- {
- name => $options->{name},
- email => $options->{email},
- password => $options->{password},
- }
- );
- $user->add_to_user_roles({ roleid => 1 });
- my $rv = $email->send;
- die $rv unless $rv;
- };
- $self->txn_do($create);
- if ($@) {
- die "Something went wrong creating a user: $@";
- exit;
- }
- }
Add Comment
Please, Sign In to add comment