Hello,
I’m building a plugin and I need to send something to a user’s email.
I use
creator = PostCreator.new(test_user, {
target_recipients: "someone@toto.com",
archetype: Archetype.private_message,
subtype: TopicSubtype.system_message,
title: "Hello test subject",
raw: "This is the message. Does it work ?"
})
test_user is admin
But every time I try to send using this, I get the error : Topic is empty
Note that target_recipients is a parameter to PostsController, not an argument for PostCreator.
That controller figures out if the recipients are users, groups or email addresses and then eventually passes it as target_emails to NewPostsManager and it ends up in TopicCreator.