Signal for sending emails after community inclusion request.
11250
def send_community_request_email(increq):
    """"""
    from flask_mail import Message
    from invenio_mail.tasks import send_email

    msg_body = format_request_email_body(increq)
    msg_title = format_request_email_title(increq)

    sender = current_app.config['COMMUNITIES_REQUEST_EMAIL_SENDER']

    msg = Message(
        msg_title,
        sender=sender,
        recipients=[increq.community.owner.email, ],
        body=msg_body
    )

    send_email.delay(msg.__dict__)
257065
def sendAppliedToOwner(self, context={}):
    
    super(ApplyMail, self).__init__(self.apply.project.owner.email, self.async, self.apply.project.owner.locale)
    return self.sendEmail('volunteerApplied-ToOwner', 'New volunteer', context)
133746
def send_mass_contributor_emails(self):
        """"""
        # If the report configuration is not active we only send to the debugging user.
        for contributor in self.contributors:
            if contributor.email not in EMAIL_SETTINGS.get("EXCLUDED", []):
                self.send_contributor_email(contributor)
876736
def putnotify(self, name, *args):
        """"""
        # self.signals[name][0].send(*args)
        self.queues[name][0].put(*args)
        self.queues[name][1].set()
394808
def add_to_emails(self, *emails):
        
        assert all(isinstance(element, (str, unicode)) for element in emails), emails
        post_parameters = emails
        headers, data = self._requester.requestJsonAndCheck(
            "POST",
            "/user/emails",
            input=post_parameters
        )
208314
def run_send_all(*args):
    '''
    
    '''
    for user_rec in MUser.query_all():
        email_add = user_rec.user_email
        send_mail([email_add],
                  "{0}|{1}".format(SMTP_CFG['name'], email_cfg['title']),
                  email_cfg['content'])
102043
def send_mail(template, to, **kwargs):
    

    def cb():
        return mail.send(to=to, template=template, **kwargs)

    return signals.send_mail(cb, data={"to": to, "template": template, "kwargs": kwargs})
515626
def resend_email_confirmation_view(self):
        """"""

        # Initialize form
        form = self.ResendEmailConfirmationFormClass(request.form)

        # Process valid POST
        if request.method == 'POST' and form.validate():

            # Find user by email
            email = form.email.data
            user, user_email = self.db_manager.get_user_and_user_email_by_email(email)

            # Send confirm_email email
            if user:
                self._send_confirm_email_email(user, user_email)

            # Redirect to the login page
            return redirect(self._endpoint_url(self.USER_AFTER_RESEND_EMAIL_CONFIRMATION_ENDPOINT))

        # Render form
        self.prepare_domain_translations()
        return render_template(self.USER_RESEND_CONFIRM_EMAIL_TEMPLATE, form=form)
565250
function notifyDevtools(msg) {
    Object.keys(ports).forEach(function(portId_) {
        ports[portId_].postMessage(msg);
    });
}
115813
def send_request_email(
        authorised_text, authorised_role, authorised_persons, application,
        link, is_secret):
    """"""
    context = CONTEXT.copy()
    context['requester'] = application.applicant
    context['link'] = link
    context['is_secret'] = is_secret
    context['application'] = application
    context['authorised_text'] = authorised_text
    _send_request_email(
        context,
        authorised_role, authorised_persons,
        "common_request")
936591
def render_or_send(func, message):
    """"""
    if request.endpoint != func.func_name:
        mail.send(message)

    if (current_user.is_authenticated() and current_user.superuser):
        return render_template('debug_email.html', message=message)
329962
def change_email(self, email):
        

        def cb():
            if not utils.is_email_valid(email):
                raise exceptions.AuthError("Email address invalid")
            self.user.change_email(email)
            return email

        return signals.user_update(self, ACTIONS["EMAIL"], cb,
                                   {"email": self.email})
618030
function confirmTransmit(outpacket, err) {
  if (this.active && err) {
    // Roll it all back into outbox (which may not be empty anymore)
    if (outpacket.responses.length > 0) {
      Array.prototype.push.apply(this.outbox.responses, outpacket.responses);
    }
    if (outpacket.requests.length > 0) {
      Array.prototype.push.apply(this.outbox.requests, outpacket.requests);
    }
  }
}
244598
def send(self, request, queryset):
        
        send_outward_mails.delay(queryset)
        # show message in the admin
        messages.info(request, _('Message sent successfully'), fail_silently=True)
649885
def send_community_nexus(val)
      reg = 'send-community extended|send-community standard|send-community'
      return 'both' if val.grep(/#{reg}/).size == 2
      val = val[0].split.last
      return 'standard' if val[/send-community/] # Workaround
      val
    end
695405
async def on_message(message):
    

    # Simplify message info
    server = message.server
    author = message.author
    channel = message.channel
    content = message.content

    data = datatools.get_data()

    # Only reply to server messages and don't reply to myself
    if server is not None and author != channel.server.me:
        prefix = data["discord"]["servers"][server.id]["prefix"]
        # Check for mentions reply to mentions
        if channel.server.me in message.mentions:
            await client.send_typing(channel)
            response = "The current server prefix is `{0}`. Type `{0}help` for help.".format(prefix)
            await client.send_message(channel, response)

        # Commands section
        if content.startswith(prefix):
            # Parse message
            package = content.split(" ")
            command = package[0][len(prefix):]
            args = package[1:]
            arg = ' '.join(args)

            # Commands
            if command not in ["prefix", "activate", "deactivate", "warnmax", "warn", "ban"]:
                return

            is_admin = author == server.owner
            for role in message.author.roles:
                if role.permissions.administrator:
                    is_admin = True

            if not is_admin:
                await client.send_typing(channel)
                reason = "You must have a role that has the permission 'Administrator'"
                embed = ui_embed.error(channel, "Insufficient Permissions", reason)
                await embed.send()
                return

            if command == "prefix" and args:
                new_prefix = arg.replace(" ", "").strip()
                data["discord"]["servers"][server.id]["prefix"] = new_prefix
                # Write the data
                datatools.write_data(data)

                await client.send_typing(channel)
                embed = ui_embed.modify_prefix(channel, new_prefix)
                await embed.send()

            if command == "warnmax" and args:
                try:
                    warn_max = int(arg)
                    if warn_max > 0:
                        data["discord"]["servers"][server.id][_data.modulename]["warnings_max"] = warn_max
                        datatools.write_data(data)
                        await client.send_typing(channel)
                        embed = ui_embed.warning_max_changed(channel, warn_max)
                        await embed.send()
                    else:
                        reason = "Maximum warnings must be greater than 0"
                        embed = ui_embed.error(channel, "Error", reason)
                        await embed.send()
                except (ValueError, TypeError):
                    reason = "Warning maximum must be a number"
                    embed = ui_embed.error(channel, "Error", reason)
                    await embed.send()
                except Exception as e:
                    logger.exception(e)

            if command == "warn" and args:
                for user in message.mentions:
                    await api_manager.warn_user(channel, user)

            if command == "ban" and args:
                for user in message.mentions:
                    await api_manager.ban_user(channel, user)

            if command == "activate" and args:
                await api_manager.activate_module(channel, arg, True)
            elif command == "deactivate" and args:
                await api_manager.activate_module(channel, arg, False)
897285
def post_message2(consumers, lti_key, url, body,
                  method='POST', content_type='application/xml'):
    
    # pylint: disable=too-many-arguments
    (response, _) = _post_patched_request(
        consumers,
        lti_key,
        body,
        url,
        method,
        content_type,
    )

    is_success = response.status == 200
    log.debug("is success %s", is_success)

    return is_success