def METHOD_NAME(self, matches):
    body = self.create_alert_body(matches)
    # post to pagerduty
    headers = {'content-type': 'application/json'}
    if self.pagerduty_api_version == 'v2':
        custom_details_payload = {'information': body} if self.pagerduty_v2_payload_include_all_info else {}
        if self.pagerduty_v2_payload_custom_details:
            for match in matches:
                for custom_details_key, es_key in list(self.pagerduty_v2_payload_custom_details.items()):
                    custom_details_payload[custom_details_key] = lookup_es_key(match, es_key)
        payload = {
            'routing_key': self.pagerduty_service_key,
            'event_action': self.pagerduty_event_type,
            'dedup_key': self.get_incident_key(matches),
            'client': self.pagerduty_client_name,
            'payload': {
                'class': self.resolve_formatted_key(self.pagerduty_v2_payload_class,
                                                    self.pagerduty_v2_payload_class_args,
                                                    matches),
                'component': self.resolve_formatted_key(self.pagerduty_v2_payload_component,
                                                        self.pagerduty_v2_payload_component_args,
                                                        matches),
                'group': self.resolve_formatted_key(self.pagerduty_v2_payload_group,
                                                    self.pagerduty_v2_payload_group_args,
                                                    matches),
                'severity': self.pagerduty_v2_payload_severity,
                'source': self.resolve_formatted_key(self.pagerduty_v2_payload_source,
                                                     self.pagerduty_v2_payload_source_args,
                                                     matches),
                'summary': self.create_title(matches),
                'custom_details': custom_details_payload,
            },
        }
        match_timestamp = lookup_es_key(matches[0], self.rule.get('timestamp_field', '@timestamp'))
        if match_timestamp:
            payload['payload']['timestamp'] = match_timestamp
    else:
        payload = {
            'service_key': self.pagerduty_service_key,
            'description': self.create_title(matches),
            'event_type': self.pagerduty_event_type,
            'incident_key': self.get_incident_key(matches),
            'client': self.pagerduty_client_name,
            'details': {
                "information": body,
            },
        }
    # set https proxy, if it was provided
    proxies = {'https': self.pagerduty_proxy} if self.pagerduty_proxy else None
    try:
        response = requests.post(
            self.url,
            data=json.dumps(payload, cls=DateTimeEncoder, ensure_ascii=False).encode("utf-8"),
            headers=headers,
            proxies=proxies
        )
        response.raise_for_status()
    except RequestException as e:
        raise EAException("Error posting to pagerduty: %s" % e)
    if self.pagerduty_event_type == 'trigger':
        elastalert_logger.info("Trigger sent to PagerDuty")
    if self.pagerduty_event_type == 'resolve':
        elastalert_logger.info("Resolve sent to PagerDuty")
    if self.pagerduty_event_type == 'acknowledge':
        elastalert_logger.info("acknowledge sent to PagerDuty")