:
#message_template.rb
$message = "Hello, this is a plaintext message."
そして、第二のヘルパーファイル:
require './message_template.rb'
require './html_template.rb'
fromLabel = "***** *******"
fromAddress = "****@mail.*******.com"
toAddress = "[email protected]*******.net"
subject = "Hello"
cmd = "curl -s --user 'api:key-*******' https://api.mailgun.net/v3/mail.*****.com/messages -F from='" + fromLabel + " <" + fromAddress + ">' -F to='" +toAddress + "' -F subject='" + subject + "' -F text='" + $message + "'" + " '+ --form-string html=' " + $htmlMessage + "'"
system (cmd)
ここで第1のヘルパーファイルです:ここで
は、メインのファイルがあります文字列
-c:「 のsh '`マッチングを探しているときに、予期しないEOF SH::-c::ライン0'
このに試してみる:
cmd = "curl -s --user 'api:key-*******' https://api.mailgun.net/v3/mail.*****.com/messages -F from='#{fromLabel} <#{fromAddress}>' -F to='#{toAddress}' -F subject='#{subject}' -F text='#{$message}' --form-string html='#{$htmlMessage}'"
以下に結果を変更、エラーコードを変更: 1行目:構文エラー:予期しないファイルの終わり ' – HMLDude
@pweslow編集を参照 – Ruslan