diff --git a/lib/Lacuna/Mailer.pm b/lib/Lacuna/Mailer.pm index fe55c453..5f1b90db 100644 --- a/lib/Lacuna/Mailer.pm +++ b/lib/Lacuna/Mailer.pm @@ -25,6 +25,8 @@ has api_key => ( sub send { my ($self, $to, $subject, $message) = @_; + return unless ($self->api_key); + my %form = ( from => $self->from, to => $to, diff --git a/lib/Lacuna/RPC/Empire.pm b/lib/Lacuna/RPC/Empire.pm index 9c8a038d..0adf57d9 100644 --- a/lib/Lacuna/RPC/Empire.pm +++ b/lib/Lacuna/RPC/Empire.pm @@ -367,6 +367,12 @@ sub create { # handle invitation $empire->attach_invite_code($account{invite_code}); + + # welcome email + $empire->send_email( + 'Welcome', + "Greetings ".$empire->name."!\n\nWelcome to The Lacuna Expanse. You are a very important member in our community, and we appreciate your patronage, feedback, and involvement.\n\nTLE Community\n".'natalie@thecommunity.com'."\nhttps://tlecommunity.com", + ); return $empire->id; }