Replaces the macros in the given message.<p>

@param msg the message in which the macros are replaced
@param recipient the recipient in the message

@return the message with the macros replaced
4093
private String replaceMacros(String msg, I_CmsNewsletterRecipient recipient) {

        CmsMacroResolver resolver = CmsMacroResolver.newInstance();
        resolver.addMacro(MACRO_USER_FIRSTNAME, recipient.getFirstname());
        resolver.addMacro(MACRO_USER_LASTNAME, recipient.getLastname());
        resolver.addMacro(MACRO_USER_FULLNAME, recipient.getFullName());
        resolver.addMacro(MACRO_USER_EMAIL, recipient.getEmail());
        resolver.addMacro(
            MACRO_SEND_DATE,
            DateFormat.getDateTimeInstance().format(new Date(System.currentTimeMillis())));
        return resolver.resolveMacros(msg);
    }
520701
public Message message(String subject, String messageBody) {
        Collection<Member> recipients = new ArrayList<Member>();
        return message(subject, messageBody, recipients);
    }
136661
public MimeMessage createMimeMessage(Session session) throws MessagingException {
		if (isEmpty(htmlPart) && isEmpty(textPart)) {
			throw new IllegalArgumentException("Missing email content");
		}
		final MimeMessage msg = new MimeMessage(session);
		msg.setSubject(subject);
		msg.setFrom(new InternetAddress(from));
		msg.setContent(createMultiPart());
		msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(recipients, false));
		return msg;
	}
501167
protected static String receipientsAsCommaSeperated(final List<BigInteger> recipients) {
        // Note: I didn't opt for using apache commons to reduce the number of includes
        // Let me know if you want to have this changed...
        if (recipients == null) {
            return null;
        }
        if (recipients.size() == 0) {
            return EMPTY;
        }
        final StringBuilder sb = new StringBuilder(recipients.size() * 10);
        for (final BigInteger s : recipients) {
            sb.append(s.toString()).append(",");
        }
        return sb.substring(0, sb.length() - 1);
    }
359013
public static function fromMessage(Message $msg)
    {
        return new self($msg->shift(), $msg->shift(), $msg->toArray());
    }
1240489
public boolean evaluateMessage(
    Selector selectorTree,
    Selector discriminatorTree,
    SIBusMessage msg)
  { 
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "evaluateMessage", new Object[] { selectorTree, discriminatorTree, msg });

    boolean ret = mpm.evaluateMessage(selectorTree, discriminatorTree, msg );
          
    if (tc.isEntryEnabled()) SibTr.exit(tc, "evaluateMessage", new Boolean(ret));
    return ret;             
  }
725446
private String formatMessage(final String message) {
        if (null != reformatter) {
            return reformatter.reformat(context, message);
        } else {
            return message;
        }
    }
832398
public void produceTopicMessage(String destinationName, String messageData, String recipients) {
        Message msg = createObjectMessage(messageData, "anonymous", recipients);
        sendMessage(destinationName, msg);
    }
49273
public boolean sendToMatching(Msg msg)
    {
        //  Is this end of a multipart message?
        boolean msgMore = msg.hasMore();

        //  Push the message to matching pipes.
        distribute(msg);

        //  If mutlipart message is fully sent, activate all the eligible pipes.
        if (!msgMore) {
            active = eligible;
        }

        more = msgMore;

        return true;
    }
841738
@Override
    public Message newMessage(final String message) {
        final ReusableSimpleMessage result = getSimple();
        result.set(message);
        return result;
    }
930115
public void setMessageText(SendableTextMessage.SendableTextMessageBuilder messageBuilder) {
        SendableTextMessage message = messageBuilder.build();
        baseMessage.getBotInstance().editMessageText(baseMessage, message.getMessage(), message.getParseMode(),
                message.isDisableWebPagePreview(), toKeyboard());
    }
31201
public WebSocketContext messageReceived(String receivedMessage) {
        this.stringMessage = S.string(receivedMessage).trim();
        isJson = stringMessage.startsWith("{") || stringMessage.startsWith("]");
        tryParseQueryParams();
        return this;
    }
1058675
static public Message createBinarySMS(String originator, String header, String body, List<BigInteger> recipients) {
        return Message.createBinarySMS(originator, header, body, receipientsAsCommaSeperated(recipients));
    }
1089662
@Override
	public Email recipient(Recipient... recipients) {
		this.recipients.addAll(Arrays.asList(recipients));
		return this;
	}
1329784
private String replaceMacros(String msg, String contentLocale) {

        CmsMacroResolver resolver = CmsMacroResolver.newInstance();
        resolver.addMacro(MACRO_DECORATION, m_decoration);
        resolver.addMacro(MACRO_DECORATIONKEY, m_decorationKey);
        if (m_locale != null) {
            resolver.addMacro(MACRO_LOCALE, m_locale.toString());
            if (!contentLocale.equals(m_locale.toString())) {
                resolver.addMacro(MACRO_LANGUAGE, "lang=\"" + m_locale.toString() + "\"");
            }
        }

        return resolver.resolveMacros(msg);
    }
1185793
@Override
    public Message newMessage(final String message, final Object... params) {
        return new StringFormattedMessage(message, params);
    }
904129
protected void populate( MimeMessage message )
    throws MessagingException
  {
    // add all of the to addresses.
    message.addRecipients(Message.RecipientType.TO, toSet.toInternetAddressArray());
    message.addRecipients(Message.RecipientType.CC, ccSet.toInternetAddressArray());
    message.addRecipients(Message.RecipientType.BCC, bccSet.toInternetAddressArray());
    message.setFrom(from);
    if( replyTo != null ) {
      message.setReplyTo(new InternetAddress[] {replyTo});
    }
    if( subject != null ) {
      message.setSubject(subject);
    }
  }