-1

how do i add a string with a variable within the subject of a notification email? i am wanting to add data from the api into the subject email but unsure on how i pass that in with a string message inbetween to form a sentence.

i want this message

`$subject = 'Hi:' $filmName 'is part of your suggestions'`

or

$subject = 'Hi:' $fullName, 'the film' $filmName, 'has been recommended'

then i can do this with the subject in the toMail method

 return (new MailMessage())
        ->subject($subject)
lilnoobcoder
  • 85
  • 1
  • 11
  • https://stackoverflow.com/questions/8336858/how-to-combine-two-strings-together-in-php – Rwd Jan 25 '20 at 11:32

1 Answers1

1

Try this -

$subject = 'Hi: '.$fullName.', the film '.$filmName.', has been recommended';
Rashed Hasan
  • 3,721
  • 11
  • 40
  • 82