You are here

protected function WebformCivicrmTestBase::addEmailHandler in Webform CiviCRM Integration 8.5

Add email handler

Parameters

array $params:

1 call to WebformCivicrmTestBase::addEmailHandler()
ExistingContactElementTest::testTokensInEmail in tests/src/FunctionalJavascript/ExistingContactElementTest.php
Test Tokens in Email.

File

tests/src/FunctionalJavascript/WebformCivicrmTestBase.php, line 511

Class

WebformCivicrmTestBase

Namespace

Drupal\Tests\webform_civicrm\FunctionalJavascript

Code

protected function addEmailHandler($params) {
  $this
    ->drupalGet("admin/structure/webform/manage/civicrm_webform_test/handlers/add/email");
  if (!empty($params['to_mail'])) {
    $this
      ->getSession()
      ->getPage()
      ->selectFieldOption('settings[to_mail][select]', $params['to_mail']);
  }
  $this
    ->getSession()
    ->getPage()
    ->selectFieldOption('edit-settings-body', '_other_');
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $this
    ->fillCKEditor('settings[body_custom_html][value]', $params['body']);
  $this
    ->getSession()
    ->getPage()
    ->pressButton('Save');
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
}