app/mailers/moderator_mailer.rb
def story_created(story)
    @story = story

    emails = Moderator.pluck(:email)
    return if emails.empty?

    subject =
      I18n.t(
        'mailers.moderator_mailer.story_created.subject',
        story_identifier: story.identifier
      )

    mail(to: emails, subject: subject)
  end
# notify moderators of a new story
notify moderators of a new story
notify moderators of a new story
def story_created(story)
    @story = story
    emails = Moderator.pluck(:email)
    return if emails.empty?
    subject =
      I18n.t(
        'mailers.moderator_mailer.story_created.subject',
        story_identifier: story.identifier
      )
    mail(to: emails, subject: subject)
  end
def story_created ( story ) @story = story emails = Moderator . pluck ( :email ) return if emails . empty? subject = I18n . t ( 'mailers.moderator_mailer.story_created.subject' , story_identifier : story . identifier ) mail ( to : emails , subject : subject ) end
notify moderators of a new story
notify moderators of a new story
story