/*
 * Copyright 2012 s_wolff.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.aegee.runanddine.mail;

/**
 * Factory to create a mail for the RHRK in the appropriate format
 * @author s_wolff
 */
public class RHRKMailFactory {

    private RHRKMailFactory() {
    }

    /**
     * Create RHRK Mail
     * @param subject Mail subject to be inserted
     * @param content Mail content to be inserted
     * @return 
     */
    public static Mail make(String subject, String content) {
        content = "--------------------- begin message ---------------------\n" + content;
        content += "\n--------------------- end message ---------------------";

        String mailContent = String.format(
                "%s\n\n%s\n\nBetreff: %s\n\nInhalt:\n%s\n",
                getSalutation(), getRecipiants(), subject, content);


        String mailSubject = "AEGEE Run&Dine";
        String to = "rmreq@rhrk.uni-kl.de";

        return new Mail(mailSubject, to, "", mailContent);
    }

    private static String getSalutation() {
        return "Hallo,\n\nwir würden gerne folgende Runmail für unser Event versenden:";
    }

    private static String getRecipiants() {
        return "Empfängerkreis: Mitarbeiter, Studenten";
    }
}
