
On Thu, Nov 12, 2020 at 07:09:21PM +0800, Luan Shengde wrote:
build email message for successfuly assign account
Signed-off-by: Luan Shengde <shdluan@163.com> --- .../assign-account/send-account-email.rb | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 container/assign-account/send-account-email.rb
diff --git a/container/assign-account/send-account-email.rb b/container/assign-account/send-account-email.rb new file mode 100755 index 0000000..7fe1447 --- /dev/null +++ b/container/assign-account/send-account-email.rb @@ -0,0 +1,30 @@ +#!/usr/bin/env ruby +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. +# frozen_string_literal: true + +def build_message(email, account_info) + message = <<~EMAIL_MESSAGE + To: #{email} + Subject: [compass-ci] jumper account is ready + + Dear user: + + Thank you for joining us. + You can use the following command to login the jumper server:
不需要缩进 email文本写在独立的ERB文件里。 Thanks, Fengguang
+ + Login command: + ssh -p #{account_info['jumper_port']} #{account_info['my_login_name']}@#{account_info['jumper_host']} + + Account password: + #{account_info['my_password']} + + Suggest: + If you use the password to login, change it in time. + + regards + compass-ci + EMAIL_MESSAGE + + return message +end -- 2.23.0