Send crash report given user's comment and email address.

@param comment   Comment (may be null) provided by the user.
@param userEmail Email address (may be null) provided by the client.
497542
protected final void sendCrash(@Nullable String comment, @Nullable String userEmail) {
        new Thread(() -> {
            final CrashReportPersister persister = new CrashReportPersister();
            try {
                if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Add user comment to " + reportFile);
                final CrashReportData crashData = persister.load(reportFile);
                crashData.put(USER_COMMENT, comment == null ? "" : comment);
                crashData.put(USER_EMAIL, userEmail == null ? "" : userEmail);
                persister.store(crashData, reportFile);
            } catch (IOException | JSONException e) {
                ACRA.log.w(LOG_TAG, "User comment not added: ", e);
            }

            // Start the report sending task
            new SchedulerStarter(this, config).scheduleReports(reportFile, false);
        }).start();
    }
134146
private function setEditableInComment(
        Comment $comment,
        string $authorUUID
    ) {
        if ($authorUUID === $comment->getAuthorUUID()) {
            $comment->setEditable(true);
        }
    }
1263898
@POST
  @Path("{id}/email")
  @RolesAllowed({"ROLE_ADMIN"})
  public Response changeEmail(@PathParam("id") Long userId, EmailRequest request) {
    checkNotNull(userId);
    checkEmailFormat(request.getEmail());

    boolean isSuccess = userService.changeEmailAddress(userId, request.getEmail());
    return isSuccess ? Response.noContent().build() : Response.status(Response.Status.BAD_REQUEST).build();
  }
305080
function attachCommentReply(comment) {
    return function reply(body, callback) {
        github.replyToReviewComment(this.repo.data.owner.login, this.repo.data.name, this.data.number, comment.id, body, callback);
    }.bind(this);
}
1173923
private function processEmail(UserInterface $user, $email, $contact = null)
    {
        if ($contact) {
            // if no email passed try to use the contact's first email
            if (null === $email &&
                array_key_exists('emails', $contact) && count($contact['emails']) > 0 &&
                $this->isEmailUnique($contact['emails'][0]['email'])
            ) {
                $email = $contact['emails'][0]['email'];
            }
            if (null !== $email) {
                if (!$this->isEmailUnique($email)) {
                    throw new EmailNotUniqueException($email);
                }
                $user->setEmail($email);
            }
        } else {
            if (null !== $email) {
                if ($email !== $user->getEmail() &&
                    !$this->isEmailUnique($email)
                ) {
                    throw new EmailNotUniqueException($email);
                }
                $user->setEmail($email);
            } else {
                $user->setEmail(null);
            }
        }
    }
1038241
public function markComment($msg_data_id, $user_comment_id, $index = null) {
        $args = $this->getMarkComment()->parameters(
            compact('msg_data_id', 'user_comment_id', 'index'))->json();
        return $args['errcode'] == 0;
    }
263220
public void setReplyTo(String address, String personal) throws AddressException {
		replyTo = toInternetAddress(address, personal);
	}
1208856
public function postComment(string $authorName, EmailAddress $authorEmail, string $content, IClock $clock): BlogArticleComment
    {
        InvalidOperationException::verify($this->published, 'This blog article is not published');
        InvalidOperationException::verify($this->allowCommenting, 'This blog article does not allow comments');

        $comment = new BlogArticleComment(
            $this,
            $authorName,
            $authorEmail,
            $content,
            $clock
        );

        $this->comments[] = $comment;

        return $comment;
    }
1231
public void remark(String openId, String remark) {
        String url = WxEndpoint.get("url.user.remark");
        String json = String.format("{\"openid\":\"%s\",\"remark\":\"%s\"}", openId, remark);
        logger.debug("remark user: {}", json);
        wxClient.post(url, json);
    }
1347326
public void comment(String message) throws IOException {
        if (message.indexOf(NEW_LINE_CHAR) != -1) {
            String line;
            int start = 0;
            while ((line = readLine(message, start)) != null) {
                writer.write(COMMENT_LINE_START);
                writer.write(SPACE_CHAR);
                writer.write(line);
                newLine();

                start += line.length();
                start = skipNewLineChar(message, start);
                if (start == -1) {
                    break;
                }
            }
            if (start != -1) {
                writer.write(COMMENT_LINE_START);
                newLine();
            }
        } else {
            writer.write(COMMENT_LINE_START);
            writer.write(SPACE_CHAR);
            writer.write(message);
            newLine();
        }
    }
823645
private final void replyErrors(final String errorMessage,
            final String stackTrace, final String statusCode,
            final int statusCodeInt) {
        reply(true, errorMessage, stackTrace, statusCode, statusCodeInt,
                PcConstants.NA, null);

    }
339502
public void setEmail(String email) {
        SystemAssert.requireArgument(email != null && !email.isEmpty(), "Email cannot be null or empty.");
        this.email = email;
    }
384642
def post_comment(self, message):
        
        report_url = (
            'https://api.github.com/repos/%s/issues/%s/comments'
            % (self.repo_name, self.pr_number)
        )
        result = self.requester.post(report_url, {'body': message})
        if result.status_code >= 400:
            log.error("Error posting comment to github. %s", result.json())
        return result
341398
protected void sendWardenEmailToUser(NotificationContext context, SubSystem subSystem) {
        EntityManager em = emf.get();
        PrincipalUser user = getWardenUser(context.getAlert().getName());
        SuspensionRecord record = SuspensionRecord.findByUserAndSubsystem(em, user, subSystem);
        Set<String> to = new HashSet<>();

        to.add(user.getEmail());

        String subject = "Warden Email Notification";
        StringBuilder message = new StringBuilder();

        message.append(MessageFormat.format("<p>{0} has been suspended from the Argus system for violating the following policy</p>",
                user.getUserName()));
        message.append(MessageFormat.format("Subsystem: {0}", subSystem.toString()));
        message.append(MessageFormat.format("<br>Policy: {0}",
                context.getAlert().getName().replace(WARDEN_ALERT_NAME_PREFIX + user.getUserName() + "-", "")));
        message.append(MessageFormat.format("<br>Threshold: {0}", context.getAlert().getTriggers().get(0).getThreshold()));
        message.append(MessageFormat.format("<br>Triggering Value: {0}", context.getTriggerEventValue()));
        if (record.getSuspendedUntil() == -1) {
            message.append("<br> You have been suspended indefinitely");
        } else {
            message.append(MessageFormat.format("<br>Reinstatement Time: {0}", DATE_FORMATTER.get().format(new Date(record.getSuspendedUntil()))));
        }
        _mailService.sendMessage(to, subject, message.toString(), "text/html; charset=utf-8", MailService.Priority.HIGH);
        to.clear();
        to.add("argus-admin@salesforce.com");
        message.append("<p><a href='").append(getAlertUrl(context.getAlert().getId())).append("'>Click here to view alert definition.</a><br/>");
        _mailService.sendMessage(to, subject, message.toString(), "text/html; charset=utf-8", MailService.Priority.HIGH);
    }
515980
def email(self, comment, content_object, request):
        
        if not self.email_notification:
            return
        recipient_list = [manager_tuple[1] for manager_tuple in settings.MANAGERS]
        t = loader.get_template('comments/comment_notification_email.txt')
        c = Context({ 'comment': comment,
                      'content_object': content_object })
        subject = '[%s] New comment posted on "%s"' % (get_current_site(request).name,
                                                          content_object)
        message = t.render(c)
        send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, recipient_list, fail_silently=True)
29601
public function postComment(int $blogArticleId, string $authorName, EmailAddress $authorEmail, string $comment): BlogArticleComment
    {
        $blogArticle = $this->blogArticleRepo->get($blogArticleId);

        $comment = $blogArticle->postComment($authorName, $authorEmail, $comment, $this->clock);

        $this->blogArticleRepo->save($blogArticle);

        return $comment;
    }
384749
public void editComment(String commentId, String commentText) throws FlickrException {
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("method", METHOD_EDIT_COMMENT);

        parameters.put("comment_id", commentId);
        parameters.put("comment_text", commentText);

        // Note: This method requires an HTTP POST request.
        Response response = transportAPI.post(transportAPI.getPath(), parameters, apiKey, sharedSecret);
        if (response.isError()) {
            throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
        }
        // This method has no specific response - It returns an empty
        // sucess response if it completes without error.
    }