class MessageTemplate::ApplySignaturePassed < MessageTemplate 

  # MessageTemplate::ApplySignaturePassed.get_message_content(User.where(phone: 15386415121), ApplySignature.last)
  def self.get_message_content(receivers, apply_signature)
    return '', '', '' if receivers.blank?
    project = apply_signature&.project
    owner = project&.owner 
    content = sys_notice.gsub('{nickname}', owner&.real_name).gsub('{repository}', project&.name)
    url = notification_url.gsub('{owner}', owner&.login).gsub('{identifier}', project&.identifier)
    if apply_signature.cdkey.present? 
      content.sub!('{ifcdkey}', '') 
      content.sub!('{endcdkey}', '')
      content.gsub!('{cdkey}', apply_signature.cdkey)
    else
      content.gsub!(/({ifcdkey})(.*)({endcdkey})/, '') 
    end
    return receivers_string(receivers), content, url
  end
end