public void SendMessageToCandidate(Guid candidateId, MessageTypes messageType, IEnumerable <CommunicationToken> tokens)
        {
            _logger.Debug("CommunicationService called to send a message of type {0} to candidate with Id={1}", messageType, candidateId);

            switch (messageType)
            {
            case MessageTypes.ApprenticeshipApplicationSubmitted:
                _sendApplicationSubmittedStrategy.Send(candidateId, tokens);
                break;

            case MessageTypes.TraineeshipApplicationSubmitted:
                _sendTraineeshipApplicationSubmittedStrategy.Send(candidateId, tokens);
                break;

            case MessageTypes.SendActivationCode:
            case MessageTypes.SendPasswordResetCode:
            case MessageTypes.SendAccountUnlockCode:
            case MessageTypes.PasswordChanged:
            case MessageTypes.SendMobileVerificationCode:
                _sendCandidateCommunicationStrategy.Send(candidateId, messageType, tokens);
                break;

            default:
                throw new ArgumentOutOfRangeException("messageType");
            }
        }
        public void Send(Guid candidateId, IEnumerable <CommunicationToken> tokens)
        {
            var candidate = _candidateReadRepository.Get(candidateId);

            var application = GetApplication(tokens);
            var vacancy     = _vacancyDataProvider.GetVacancyDetails(application.Vacancy.Id, true);

            var applicationTokens = new[]
            {
                new CommunicationToken(CommunicationTokens.CandidateFirstName, candidate.RegistrationDetails.FirstName),
                new CommunicationToken(CommunicationTokens.ApplicationVacancyTitle, vacancy.Title),
                new CommunicationToken(CommunicationTokens.ApplicationVacancyReference, vacancy.VacancyReference)
            };

            _sendCandidateCommunicationStrategy.Send(candidateId, MessageTypes.ApprenticeshipApplicationSubmitted, applicationTokens);
        }