So here\'s what my code (pretty much) looks like to create a message using the google-api-ruby-client:
service ||= Google::Apis::GmailV1::GmailService.new
m
Looking at the source on GitHub for send_user_message shows that it doesn't take a thread_id
as a parameter. However the Message class does have it as an attribute.
So perhaps trying this should work:
service ||= Google::Apis::GmailV1::GmailService.new
message = RMail::Message.new
message.header['To'] = params[:gmail][:to]
message.header['From'] = current_user_google_user_id
message.header['Subject'] = params[:gmail][:subject]
message.header['Subject'] = params[:gmail][:subject]
message.body = params[:gmail][:body]
message.thread_id = params[:gmail][:thread_id]
service.send_user_message(
current_user_google_user_id,
upload_source: StringIO.new(message.to_s),
content_type: 'message/rfc822'
)