Method: FakeSMTPd::MessageStore#store

Defined in:
lib/fakesmtpd/server.rb

#store(message_id, from, recipients, body) ⇒ Object



370
371
372
373
374
375
376
377
378
379
380
381
# File 'lib/fakesmtpd/server.rb', line 370

def store(message_id, from, recipients, body)
  outfile = File.join(message_dir, "fakesmtpd-client-#{message_id}.json")
  File.open(outfile, 'w:UTF-8') do |f|
    f.write JSON.pretty_generate(
      message_id: message_id,
      from: from,
      recipients: recipients,
      body: body,
    )
  end
  outfile
end