مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-12-01 05:43:04 +00:00
16 أسطر
550 B
Ruby
16 أسطر
550 B
Ruby
# frozen_string_literal: true
|
|
|
|
module GeneralHelpers
|
|
|
|
def create_plain_text_message(server, text, to = "test@example.com", override_attributes = {})
|
|
domain = create(:domain, owner: server)
|
|
attributes = { from: "test@#{domain.name}", subject: "Test Plain Text Message" }.merge(override_attributes)
|
|
attributes[:to] = to
|
|
attributes[:plain_body] = text
|
|
message = OutgoingMessagePrototype.new(server, "127.0.0.1", "testsuite", attributes)
|
|
result = message.create_message(to)
|
|
server.message_db.message(result[:id])
|
|
end
|
|
|
|
end
|