libra/docs/stories/story-8.2-welcome-email.md

1.7 KiB

Story 8.2: Welcome Email (Account Created)

Epic Reference

Epic 8: Email Notification System

User Story

As a new client, I want to receive a welcome email with my login credentials, So that I can access the platform.

Acceptance Criteria

Trigger

  • Sent automatically on user creation by admin
  • Queued for performance

Content

  • Personalized greeting (name/company)
  • "Your account has been created" message
  • Login credentials (email, password)
  • Login URL link with button
  • Brief platform introduction
  • Contact info for questions

Language

  • Email in user's preferred_language
  • Arabic template
  • English template

Design

  • Professional branding
  • Call-to-action button: "Login Now"

Technical Notes

class WelcomeEmail extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct(
        public User $user,
        public string $password
    ) {}

    public function envelope(): Envelope
    {
        return new Envelope(
            subject: $this->user->preferred_language === 'ar'
                ? 'مرحباً بك في مكتب ليبرا للمحاماة'
                : 'Welcome to Libra Law Firm',
        );
    }

    public function content(): Content
    {
        return new Content(
            markdown: 'emails.welcome.' . ($this->user->preferred_language ?? 'ar'),
        );
    }
}

Definition of Done

  • Email sent on user creation
  • Credentials included
  • Arabic template works
  • English template works
  • Login button works
  • Tests pass

Estimation

Complexity: Low | Effort: 2-3 hours