lib/email/hook_creator/send_transactional_mail.rb
def validate_template_vars
        
        return error_with_data(
            'e_hc_stm_2',
            'something_went_wrong',
            GlobalConstant::ErrorAction.default
        ) if @template_vars[:company_web_domain].blank?

        if GlobalConstant::PepoCampaigns.is_double_opt_in_related_template?(@template_name)

          return error_with_data(
            'e_hc_stm_3',
            'something_went_wrong',
            GlobalConstant::ErrorAction.default
          ) if @template_vars[:double_opt_in_token].blank?

        elsif GlobalConstant::PepoCampaigns.is_device_verification_related_template?(@template_name)

          return error_with_data(
            'e_hc_stm_4',
            'something_went_wrong',
            GlobalConstant::ErrorAction.default
          ) if @template_vars[:device_verification_token].blank?

        elsif GlobalConstant::PepoCampaigns.is_forgot_password_template?(@template_name)

          return error_with_data(
              'e_hc_stm_5',
              'something_went_wrong',
              GlobalConstant::ErrorAction.default
          ) if @template_vars[:reset_password_token].blank?

        elsif GlobalConstant::PepoCampaigns.is_manager_invite_template?(@template_name)

          return error_with_data(
              'e_hc_stm_6',
              'something_went_wrong',
              GlobalConstant::ErrorAction.default
          ) if @template_vars[:invite_token].blank?

        elsif GlobalConstant::PepoCampaigns.is_mainnet_whitelisting_template?(@template_name)

          return error_with_data(
            'e_hc_stm_7',
            'something_went_wrong',
            GlobalConstant::ErrorAction.default
          ) if @template_vars[:manager_email_id].blank?

        elsif GlobalConstant::PepoCampaigns.is_recovery_request_submission_template?(@template_name)
  
          return error_with_data(
            'e_hc_stm_8',
            'something_went_wrong',
            GlobalConstant::ErrorAction.default
          ) if @template_vars[:manager_email_id].blank?

        elsif GlobalConstant::PepoCampaigns.is_test_economy_invite_template?(@template_name)

          if @template_vars[:qr_code_url].blank? || @template_vars[:ios_app_download_link].blank? ||
            @template_vars[:android_app_download_link].blank? || @template_vars[:deep_link_demo_app_launch_url].blank? ||
            @template_vars[:token_name].blank? || @template_vars[:inviter_name].blank?

            Rails.logger.error("invalid template_vars: #{@template_vars.inspect} for template_name: #{@template_name}")

          return error_with_data(
            'e_hc_stm_9',
            'something_went_wrong',
            GlobalConstant::ErrorAction.default
          ) if @template_vars[:qr_code_url].blank?
          #TODO: Open this up when we have these links set in ENV vars
          #   || @template_vars[:ios_app_download_link].blank? ||
          #   @template_vars[:android_app_download_link].blank?

          end

        end

        success

      end
# depending on template name validate mandatory template vars
#
# * Author: Puneet
# * Date: 12/01/2018
# * Reviewed By:
#
# @return [Result::Base] returns an object of Result::Base class
#
depending on template name validate mandatory template vars
Author: Puneet
Date: 12/01/2018
Reviewed By.
depending on template name validate mandatory template vars Author : Puneet Date : 12 / 01 / 2018 Reviewed By .
def validate_template_vars
        return error_with_data(
            'e_hc_stm_2',
            'something_went_wrong',
            GlobalConstant::ErrorAction.default
        ) if @template_vars[:company_web_domain].blank?
        if GlobalConstant::PepoCampaigns.is_double_opt_in_related_template?(@template_name)
          return error_with_data(
            'e_hc_stm_3',
            'something_went_wrong',
            GlobalConstant::ErrorAction.default
          ) if @template_vars[:double_opt_in_token].blank?
        elsif GlobalConstant::PepoCampaigns.is_device_verification_related_template?(@template_name)
          return error_with_data(
            'e_hc_stm_4',
            'something_went_wrong',
            GlobalConstant::ErrorAction.default
          ) if @template_vars[:device_verification_token].blank?
        elsif GlobalConstant::PepoCampaigns.is_forgot_password_template?(@template_name)
          return error_with_data(
              'e_hc_stm_5',
              'something_went_wrong',
              GlobalConstant::ErrorAction.default
          ) if @template_vars[:reset_password_token].blank?
        elsif GlobalConstant::PepoCampaigns.is_manager_invite_template?(@template_name)
          return error_with_data(
              'e_hc_stm_6',
              'something_went_wrong',
              GlobalConstant::ErrorAction.default
          ) if @template_vars[:invite_token].blank?
        elsif GlobalConstant::PepoCampaigns.is_mainnet_whitelisting_template?(@template_name)
          return error_with_data(
            'e_hc_stm_7',
            'something_went_wrong',
            GlobalConstant::ErrorAction.default
          ) if @template_vars[:manager_email_id].blank?
        elsif GlobalConstant::PepoCampaigns.is_recovery_request_submission_template?(@template_name)
          return error_with_data(
            'e_hc_stm_8',
            'something_went_wrong',
            GlobalConstant::ErrorAction.default
          ) if @template_vars[:manager_email_id].blank?
        elsif GlobalConstant::PepoCampaigns.is_test_economy_invite_template?(@template_name)
          if @template_vars[:qr_code_url].blank? || @template_vars[:ios_app_download_link].blank? ||
            @template_vars[:android_app_download_link].blank? || @template_vars[:deep_link_demo_app_launch_url].blank? ||
            @template_vars[:token_name].blank? || @template_vars[:inviter_name].blank?
            Rails.logger.error("invalid template_vars: #{@template_vars.inspect} for template_name: #{@template_name}")
          return error_with_data(
            'e_hc_stm_9',
            'something_went_wrong',
            GlobalConstant::ErrorAction.default
          ) if @template_vars[:qr_code_url].blank?
          end
        end
        success
      end
def validate_template_vars return error_with_data ( 'e_hc_stm_2' , 'something_went_wrong' , GlobalConstant :: ErrorAction . default ) if @template_vars [ :company_web_domain ] . blank? if GlobalConstant :: PepoCampaigns . is_double_opt_in_related_template? ( @template_name ) return error_with_data ( 'e_hc_stm_3' , 'something_went_wrong' , GlobalConstant :: ErrorAction . default ) if @template_vars [ :double_opt_in_token ] . blank? elsif GlobalConstant :: PepoCampaigns . is_device_verification_related_template? ( @template_name ) return error_with_data ( 'e_hc_stm_4' , 'something_went_wrong' , GlobalConstant :: ErrorAction . default ) if @template_vars [ :device_verification_token ] . blank? elsif GlobalConstant :: PepoCampaigns . is_forgot_password_template? ( @template_name ) return error_with_data ( 'e_hc_stm_5' , 'something_went_wrong' , GlobalConstant :: ErrorAction . default ) if @template_vars [ :reset_password_token ] . blank? elsif GlobalConstant :: PepoCampaigns . is_manager_invite_template? ( @template_name ) return error_with_data ( 'e_hc_stm_6' , 'something_went_wrong' , GlobalConstant :: ErrorAction . default ) if @template_vars [ :invite_token ] . blank? elsif GlobalConstant :: PepoCampaigns . is_mainnet_whitelisting_template? ( @template_name ) return error_with_data ( 'e_hc_stm_7' , 'something_went_wrong' , GlobalConstant :: ErrorAction . default ) if @template_vars [ :manager_email_id ] . blank? elsif GlobalConstant :: PepoCampaigns . is_recovery_request_submission_template? ( @template_name ) return error_with_data ( 'e_hc_stm_8' , 'something_went_wrong' , GlobalConstant :: ErrorAction . default ) if @template_vars [ :manager_email_id ] . blank? elsif GlobalConstant :: PepoCampaigns . is_test_economy_invite_template? ( @template_name ) if @template_vars [ :qr_code_url ] . blank? || @template_vars [ :ios_app_download_link ] . blank? || @template_vars [ :android_app_download_link ] . blank? || @template_vars [ :deep_link_demo_app_launch_url ] . blank? || @template_vars [ :token_name ] . blank? || @template_vars [ :inviter_name ] . blank? Rails . logger . error ( "invalid template_vars: #{@template_vars.inspect} for template_name: #{@template_name}" ) return error_with_data ( 'e_hc_stm_9' , 'something_went_wrong' , GlobalConstant :: ErrorAction . default ) if @template_vars [ :qr_code_url ] . blank? end end success end
depending on template name validate mandatory template vars
 Author: Puneet
 Date: 12/01/2018
 Reviewed By:
depending on template name validate mandatory template vars Author : Puneet Date : 12 / 01 / 2018 Reviewed By :
#TODO: Open this up when we have these links set in ENV vars #   || @template_vars[:ios_app_download_link].blank? || #   @template_vars[:android_app_download_link].blank?
returns an object of Result::Base class
returns an object of Result :: Base class
Result::Base